Skip to content

Commit f1a25c7

Browse files
committed
respect key ordering
1 parent 81ce586 commit f1a25c7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

firebase-database/src/main/java/com/google/firebase/database/core/utilities/PushIdGenerator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ public static final String predecessor(String key) {
7979
StringBuilder next = new StringBuilder(key);
8080
if (next.charAt(next.length() - 1) == MIN_PUSH_CHAR) {
8181
if (next.length() == 1) {
82-
// Empty keys are not allowed, but `getMinName()` sorts
83-
// lower than any other key.
84-
return ChildKey.getMinName().toString();
82+
return String.valueOf(Integer.MAX_VALUE);
8583
}
8684
// If the last character is the smallest possible character, then the next
8785
// smallest string is the prefix of `key` without it.

0 commit comments

Comments
 (0)