Undo one fragment of 054e6826.

054e6826 got the condition wrong and strcmp saves a bunch of
allocations.

Change-Id: Iac7cbdd0b63747684c2f245868a7911c5f7eba57
This commit is contained in:
Adam Langley 2015-04-13 15:59:36 -07:00
parent b16346b0ad
commit 1f26ed767a

View File

@ -16,6 +16,7 @@
#include <vector> #include <vector>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "internal.h" #include "internal.h"
@ -29,7 +30,7 @@ bool ParseKeyValueArguments(std::map<std::string, std::string> *out_args,
const std::string &arg = args[i]; const std::string &arg = args[i];
const struct argument *templ = nullptr; const struct argument *templ = nullptr;
for (size_t j = 0; templates[j].name[0] != 0; j++) { for (size_t j = 0; templates[j].name[0] != 0; j++) {
if (arg != std::string(templates[j].name)) { if (strcmp(arg.c_str(), templates[j].name) == 0) {
templ = &templates[j]; templ = &templates[j];
break; break;
} }