Skip to contentSkip to conversation

hashtable: remove caps buffer

PATCH New Heinrich Schuchardt 2 participants 2 messages Jan 23, 2019 – Jan 27, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hashtable: remove caps buffer

slre_match() checks if caps == NULL. In this case it does not try to update it. So there is no need to create a buffer caps which we do not evaluate.

---
Tested successfully on Travis CI:
https://travis-ci.org/xypron2/u-boot/builds/483161121

---
 lib/hashtable.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/hashtable.c +1 -2
index 93028ed83b..50ff40a397 100644
@@ -542,9 +542,8 @@ static int match_string(int flag, const char *str, const char *pat, void *priv)
 	case H_MATCH_REGEX:
 		{
 			struct slre *slrep = (struct slre *)priv;
-			struct cap caps[slrep->num_caps + 2];
 
-			if (slre_match(slrep, str, strlen(str), caps))
+			if (slre_match(slrep, str, strlen(str), NULL))
 				return 1;
 		}
 		break;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 hashtable: remove caps buffer

Quoted 5 lines · Heinrich Schuchardt

slre_match() checks if caps == NULL. In this case it does not try to update it. So there is no need to create a buffer caps which we do not evaluate.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190126/eed1690c/attachment.sig>