Browse Source

htable: set str shortcut to iterator name

- intended for optimization of iterator search by name
Elena-Ramona Modroiu 11 năm trước cách đây
mục cha
commit
583c705374
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      modules/htable/ht_api.c

+ 2 - 0
modules/htable/ht_api.c

@@ -1400,6 +1400,8 @@ int ht_iterator_start(str *iname, str *hname)
 		}
 		strncpy(_ht_iterators[k].bname, iname->s, iname->len);
 		_ht_iterators[k].bname[iname->len] = '\0';
+		_ht_iterators[k].name.len = iname->len;
+		_ht_iterators[k].name.s = _ht_iterators[k].bname;
 	}
 	_ht_iterators[k].it = NULL;
 	_ht_iterators[k].slot = 0;