perf:优化部分代码

This commit is contained in:
曾文豪
2023-08-14 15:43:48 +08:00
parent 28a2fa0262
commit 0fabc7aae9
11 changed files with 79534 additions and 46 deletions

View File

@@ -26,7 +26,8 @@ public class ServletKit extends ServletUtil {
* @return
*/
public static String getClientIP() {
return getClientIP(getRequest());
HttpServletRequest request = getRequest();
return getClientIP(request);
}

View File

@@ -179,7 +179,7 @@ public class Searcher {
this.ioCount = 0;
// locate the segment index block based on the vector index
int sPtr = 0, ePtr = 0;
int sPtr, ePtr;
int il0 = (int) ((ip >> 24) & 0xFF);
int il1 = (int) ((ip >> 16) & 0xFF);
int idx = il0 * VectorIndexCols * VectorIndexSize + il1 * VectorIndexSize;