| 161 | } |
| 162 | |
| 163 | static void InsertMap(PSIMPLE_MAP map, int8_t k, int8_t v) { |
| 164 | for (uint32_t i = 0; i < map->CurMapCnt; i++) { |
| 165 | if (map->CharCharMap[i * 2] == k) { |
| 166 | map->CharCharMap[i * 2 + 1] = v; |
| 167 | return; |
| 168 | } |
| 169 | } |
| 170 | if (map->CurMapCnt >= map->CharMapSize) |
| 171 | return; |
| 172 | map->CharCharMap[map->CurMapCnt * 2] = k; |
| 173 | map->CharCharMap[map->CurMapCnt * 2 + 1] = v; |
| 174 | map->CurMapCnt++; |
| 175 | } |
| 176 | |
| 177 | static int8_t FindInMap(PSIMPLE_MAP map, int8_t k, int *found) { |
| 178 | for (uint32_t i = 0; i < map->CurMapCnt; i++) { |
no outgoing calls
no test coverage detected