File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,24 +224,18 @@ DBdeparr* DBAPI::getStationBoard(
224224 return deparr;
225225 }
226226
227- uint8_t hash [20 ];
227+ uint8_t current_hash [20 ];
228228 // hash to save RAM as the ID is >150 chars
229- sha1 (doc[" zuglaufId" ].as <String>(), hash );
229+ sha1 (doc[" zuglaufId" ].as <String>(), current_hash );
230230
231231 bool match = false ;
232232 for (uint8_t i = 0 ; i < cnt && !match; i++) {
233- bool mismatch = false ;
234- for (uint8_t j = 0 ; j < 20 ; j++) {
235- if (hashes[i][j] != hash[j]) {
236- mismatch = true ;
237- break ;
238- }
239- match |= !mismatch;
240- }
233+ match |= !memcmp (hashes[i], current_hash, sizeof (current_hash));
241234 }
242235 // duplicate entry found, skipping
243236 if (match) continue ;
244237 memcpy (hashes[cnt], hash, sizeof (hash));
238+ memcpy (hashes[cnt], current_hash, sizeof (current_hash));
245239
246240 DBdeparr* da = new DBdeparr ();
247241 String targ = doc[abfahrt?" richtung" :" abgangsOrt" ];
You can’t perform that action at this time.
0 commit comments