func (fc *FCache) finishKeyMap(indexes map[interface{}]*keyMap, new []Key) error {
	for _, k := range new {
		// Detect index in new that's not in old
		km, ok := indexes[k.Index]
		if !ok || !km.detect {
			return ErrIncongruentKeys
		}

		// Ensure we skip if old and new are the same
		if reflect.DeepEqual(km.old, k.Key) {
			delete(indexes, k.Index)
			continue
		}

		// Ensure we detect duplicates in later iterations
		km.new = k.Key
		km.detect = false
	}

	return nil
}
// finishKeyMap completes the work of fillKeyMap by walking through
// the list of new keys, detecting duplications and handling them
// appropriately.  The cache MUST be locked upon entry to this method.
finishKeyMap completes the work of fillKeyMap by walking through
the list of new keys, detecting duplications and handling them
appropriately.  The cache MUST be locked upon entry to this method.
// finishKeyMap completes the work of fillKeyMap by walking through // the list of new keys detecting duplications and handling them // appropriately . The cache MUST be locked upon entry to this method .
func (fc *FCache) finishKeyMap(indexes map[interface{}]*keyMap, new []Key) error {
	for _, k := range new {
		km, ok := indexes[k.Index]
		if !ok || !km.detect {
			return ErrIncongruentKeys
		}
		if reflect.DeepEqual(km.old, k.Key) {
			delete(indexes, k.Index)
			continue
		}
		km.new = k.Key
		km.detect = false
	}
	return nil
}
func ( fc * FCache ) finishKeyMap ( indexes map [ interface { } ] * keyMap , new [ ] Key ) error { for _ , k := range new { km , ok := indexes [ k . Index ] if ! ok || ! km . detect { return ErrIncongruentKeys } if reflect . DeepEqual ( km . old , k . Key ) { delete ( indexes , k . Index ) continue } km . new = k . Key km . detect = false } return nil }
finishKeyMap completes the work of fillKeyMap by walking through
the list of new keys, detecting duplications and handling them
appropriately.
finishKeyMap completes the work of fillKeyMap by walking through the list of new keys detecting duplications and handling them appropriately .
// Detect index in new that's not in old // Ensure we skip if old and new are the same // Ensure we detect duplicates in later iterations