GHash: use reinsert instead of remove/insert

This commit is contained in:
Campbell Barton 2015-01-08 19:58:01 +11:00
parent 9fadacfd0f
commit 4305950fc0
2 changed files with 2 additions and 4 deletions

View File

@ -172,8 +172,7 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
MovieTrackingTrack *new_track = BKE_tracking_track_duplicate(track);
/* Update old-new track mapping */
BLI_ghash_remove(map->hash, track, NULL, NULL);
BLI_ghash_insert(map->hash, track, new_track);
BLI_ghash_reinsert(map->hash, track, new_track, NULL, NULL);
BLI_addtail(&tracks, new_track);
}

View File

@ -363,8 +363,7 @@ static void do_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf, boo
item->priority_data = cache->getprioritydatafp(userkey);
}
BLI_ghash_remove(cache->hash, key, moviecache_keyfree, moviecache_valfree);
BLI_ghash_insert(cache->hash, key, item);
BLI_ghash_reinsert(cache->hash, key, item, moviecache_keyfree, moviecache_valfree);
if (cache->last_userkey) {
memcpy(cache->last_userkey, userkey, cache->keysize);