diff options
| author | David Bremner <david@tethera.net> | 2015-01-02 17:18:42 +0100 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-01-02 17:18:42 +0100 |
| commit | 105537a809d1a385a3151de0c5b6235773782040 (patch) | |
| tree | 0f598b15cf1cbfae394422c7979235bb43b049d0 /lib | |
| parent | 3d978a0d61df072de7e4fd52120f3448cf8e9df6 (diff) | |
lib: convert two "iterator copy strings" into references.
Apparently this is a supported and even idiomatic way of keeping a
temporary object (e.g. like that returned from an operator
dereference) alive.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/message.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/message.cc b/lib/message.cc index bacb4d46..956a70a9 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -283,7 +283,7 @@ _notmuch_message_get_term (notmuch_message_t *message, if (i == end) return NULL; - std::string term = *i; + const std::string &term = *i; if (strncmp (term.c_str(), prefix, prefix_len)) return NULL; @@ -641,7 +641,7 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message) unsigned int directory_id; const char *direntry, *directory; char *colon; - const std::string term = *i; + const std::string &term = *i; /* Terminate loop at first term without desired prefix. */ if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len)) |
