Skip to content

Commit 09deb06

Browse files
committed
improve binary search bisecting expression
Signed-off-by: Kaushal Kumar <[email protected]>
1 parent 6e9a853 commit 09deb06

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/workload-management/src/main/java/org/opensearch/plugin/wlm/rule/storage/DefaultAttributeValueStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private String findLongestMatchingPrefix(String key) {
7575
int high = key.length() - 1;
7676

7777
while (low < high) {
78-
int mid = low + (high - low + 1) / 2;
78+
int mid = (high + low + 1) / 2;
7979
/**
8080
* This operation has O(1) complexity because prefixMap returns only the iterator
8181
*/

plugins/workload-management/src/main/java/org/opensearch/plugin/wlm/rule/storage/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* compatible open source license.
77
*/
88

9-
package org.opensearch.plugin.wlm.rule.storage;
109
/**
1110
* This package contains interfaces and implementations for in memory rule storage mechanisms
1211
*/
12+
package org.opensearch.plugin.wlm.rule.storage;

0 commit comments

Comments
 (0)