Is there a reason not to retain the returned value from `mapiterkey` on
line 1243 of reflect/value.go[1] for use on line 1249[2].

// Key returns the key of the iterator's current map entry.
func (it *MapIter) Key() Value {
        if == nil {
                panic("MapIter.Key called before Next")
        if mapiterkey( == nil { //L1243
                panic("MapIter.Key called on exhausted iterator")

        t := (*mapType)(unsafe.Pointer(it.m.typ))
        ktype := t.key
        return copyVal(ktype,|flag(ktype.Kind()), 
mapiterkey( // L1249

The same question applies to `*MapIter.Value` method just below `Key`.



You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To view this discussion on the web visit

Reply via email to