diff options
author | Peng Wu <alexepico@gmail.com> | 2016-05-19 16:45:44 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2016-05-19 16:45:44 +0800 |
commit | 6fb0d50ded3f1666159bb713d381ab269d11e21d (patch) | |
tree | bf48aec306e1d19eb0f807cf91e25928cf9ef144 /src/storage | |
parent | a3d54898d4a86260bcd242bc68f361e7de614a36 (diff) | |
download | libpinyin-6fb0d50ded3f1666159bb713d381ab269d11e21d.tar.gz libpinyin-6fb0d50ded3f1666159bb713d381ab269d11e21d.tar.xz libpinyin-6fb0d50ded3f1666159bb713d381ab269d11e21d.zip |
fixes a typo
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/phonetic_key_matrix.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/storage/phonetic_key_matrix.cpp b/src/storage/phonetic_key_matrix.cpp index 61554fb..bd48f38 100644 --- a/src/storage/phonetic_key_matrix.cpp +++ b/src/storage/phonetic_key_matrix.cpp @@ -250,13 +250,19 @@ int search_matrix(FacadeChewingTable2 * table, GArray * key_rests = g_array_new(TRUE, TRUE, sizeof(ChewingKeyRest)); matrix->get_items(start, keys, key_rests); - const size_t len = keys->len; + const size_t start_len = keys->len; + + matrix->get_items(end, keys, key_rests); + const size_t end_len = keys->len; g_array_free(keys, TRUE); g_array_free(key_rests, TRUE); + if (0 == start_len) + return SEARCH_NONE; + /* for empty column simply return SEARCH_CONTINUED. */ - if (0 == len) + if (0 == end_len) return SEARCH_CONTINUED; GArray * cached_keys = g_array_new(TRUE, TRUE, sizeof(ChewingKey)); |