mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
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.
This commit is contained in:
parent
3d978a0d61
commit
105537a809
1 changed files with 2 additions and 2 deletions
|
@ -283,7 +283,7 @@ _notmuch_message_get_term (notmuch_message_t *message,
|
||||||
if (i == end)
|
if (i == end)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
std::string term = *i;
|
const std::string &term = *i;
|
||||||
if (strncmp (term.c_str(), prefix, prefix_len))
|
if (strncmp (term.c_str(), prefix, prefix_len))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message)
|
||||||
unsigned int directory_id;
|
unsigned int directory_id;
|
||||||
const char *direntry, *directory;
|
const char *direntry, *directory;
|
||||||
char *colon;
|
char *colon;
|
||||||
const std::string term = *i;
|
const std::string &term = *i;
|
||||||
|
|
||||||
/* Terminate loop at first term without desired prefix. */
|
/* Terminate loop at first term without desired prefix. */
|
||||||
if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len))
|
if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len))
|
||||||
|
|
Loading…
Reference in a new issue