mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
am 8ab50811
: Merge "Add missing error check in TrieMap."
* commit '8ab508117da569754b6df3646a5932246fc927f7': Add missing error check in TrieMap.
This commit is contained in:
commit
0ca71d4aca
@ -79,6 +79,9 @@ int TrieMap::getNextLevelBitmapEntryIndex(const int key, const int bitmapEntryIn
|
|||||||
}
|
}
|
||||||
// Create a value entry and a bitmap entry.
|
// Create a value entry and a bitmap entry.
|
||||||
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
|
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
|
||||||
|
if (valueEntryIndex == INVALID_INDEX) {
|
||||||
|
return INVALID_INDEX;
|
||||||
|
}
|
||||||
if (!writeEntry(Entry(0, terminalEntry.getValue()), valueEntryIndex)) {
|
if (!writeEntry(Entry(0, terminalEntry.getValue()), valueEntryIndex)) {
|
||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
}
|
}
|
||||||
@ -195,6 +198,9 @@ bool TrieMap::writeValue(const uint64_t value, const int terminalEntryIndex) {
|
|||||||
}
|
}
|
||||||
// Create value entry and write value.
|
// Create value entry and write value.
|
||||||
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
|
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
|
||||||
|
if (valueEntryIndex == INVALID_INDEX) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!writeEntry(Entry(value >> (FIELD1_SIZE * CHAR_BIT), value), valueEntryIndex)) {
|
if (!writeEntry(Entry(value >> (FIELD1_SIZE * CHAR_BIT), value), valueEntryIndex)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user