func (fc *FCache) fillKeyMap(ent *entry) (map[interface{}]*keyMap, error) {
	indexes := map[interface{}]*keyMap{}
	for _, k := range ent.content.Keys {
		// Make sure it's a defined index
		idx, ok := fc.indexes[k.Index]
		if !ok {
			continue
		}

		// Filter out duplications
		if _, ok := indexes[k.Index]; ok {
			continue
		}

		// Make sure it's this entry that's there
		if tmp, ok := idx.entries[k.Key]; !ok || !reflect.DeepEqual(ent.content, tmp.content) {
			return nil, ErrEntryNotFound
		}

		indexes[k.Index] = &keyMap{
			idx:    idx,
			old:    k.Key,
			detect: true,
		}
	}

	return indexes, nil
}
// fillKeyMap is a helper for Reindex that fills in the "old" side of
// the keyMap given the existing cache entry.  The cache MUST be
// locked upon entry to this method.
fillKeyMap is a helper for Reindex that fills in the "old" side of
the keyMap given the existing cache entry.  The cache MUST be
locked upon entry to this method.
// fillKeyMap is a helper for Reindex that fills in the " old " side of // the keyMap given the existing cache entry . The cache MUST be // locked upon entry to this method .
func (fc *FCache) fillKeyMap(ent *entry) (map[interface{}]*keyMap, error) {
	indexes := map[interface{}]*keyMap{}
	for _, k := range ent.content.Keys {
		idx, ok := fc.indexes[k.Index]
		if !ok {
			continue
		}
		if _, ok := indexes[k.Index]; ok {
			continue
		}
		if tmp, ok := idx.entries[k.Key]; !ok || !reflect.DeepEqual(ent.content, tmp.content) {
			return nil, ErrEntryNotFound
		}
		indexes[k.Index] = &keyMap{
			idx:    idx,
			old:    k.Key,
			detect: true,
		}
	}
	return indexes, nil
}
func ( fc * FCache ) fillKeyMap ( ent * entry ) ( map [ interface { } ] * keyMap , error ) { indexes := map [ interface { } ] * keyMap { } for _ , k := range ent . content . Keys { idx , ok := fc . indexes [ k . Index ] if ! ok { continue } if _ , ok := indexes [ k . Index ] ; ok { continue } if tmp , ok := idx . entries [ k . Key ] ; ! ok || ! reflect . DeepEqual ( ent . content , tmp . content ) { return nil , ErrEntryNotFound } indexes [ k . Index ] = & keyMap { idx : idx , old : k . Key , detect : true , } } return indexes , nil }
fillKeyMap is a helper for Reindex that fills in the "old" side of
the keyMap given the existing cache entry.
fillKeyMap is a helper for Reindex that fills in the " old " side of the keyMap given the existing cache entry .
// Make sure it's a defined index // Filter out duplications // Make sure it's this entry that's there