[sr-dev] git:4.2: htable: set str shortcut to iterator name

Elena-Ramona Modroiu ramona at rosdev.ro
Tue Oct 28 11:45:55 CET 2014


Module: sip-router
Branch: 4.2
Commit: 7d6ad74fece3cb038ce3c8c3e82bd7380bfca3fa
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7d6ad74fece3cb038ce3c8c3e82bd7380bfca3fa

Author: Elena-Ramona Modroiu <ramona at asipto.com>
Committer: Elena-Ramona Modroiu <ramona at asipto.com>
Date:   Tue Oct 28 11:41:47 2014 +0100

htable: set str shortcut to iterator name

- intended for optimization of iterator search by name
(cherry picked from commit 583c705374c9e1da7817bf204b3da225c784e54a)

---

 modules/htable/ht_api.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c
index a57af23..13d373d 100644
--- a/modules/htable/ht_api.c
+++ b/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;




More information about the sr-dev mailing list