Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Have MutlipartHeaders.operator[] return a const reference for improve…

…d efficiency.
  • Loading branch information...
commit 89e87147096b81d5687af60f46b70ff79ff9b16b 1 parent 91a7d86
@FooBarWidget authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 MultipartReader.h
View
6 MultipartReader.h
@@ -6,11 +6,13 @@
#include "MultipartParser.h"
class MultipartHeaders: public std::multimap<std::string, std::string> {
+private:
+ std::string empty;
public:
- std::string operator[](const std::string &key) const {
+ const std::string &operator[](const std::string &key) const {
const_iterator it = find(key);
if (it == end()) {
- return std::string();
+ return empty;
} else {
return it->second;
}
Please sign in to comment.
Something went wrong with that request. Please try again.