unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 0/3] ruby: get rid of Tags object
@ 2023-03-22 23:43 Felipe Contreras
  2023-03-22 23:43 ` [PATCH 1/3] ruby: add tags helper Felipe Contreras
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Felipe Contreras @ 2023-03-22 23:43 UTC (permalink / raw)
  To: notmuch; +Cc: arcnmx

We don't need a Tags enumerable object only for a small number of strings, we
can just get them directly.

This fixes an interaction problem where we might request two tags iterables
from the same message:

  tags_0 = notmuch_message_get_tags(message);
  // Store it for later
  tags_1 = notmuch_message_get_tags(message);
  // Traverse it

This iterator is meant to be transient and works only once, so we better just
iterate it once.

Felipe Contreras (3):
  ruby: add tags helper
  ruby: tags: return string array directly
  ruby: remove Tags object

 bindings/ruby/database.c |  2 +-
 bindings/ruby/defs.h     |  6 +----
 bindings/ruby/init.c     | 14 -----------
 bindings/ruby/message.c  |  2 +-
 bindings/ruby/messages.c |  2 +-
 bindings/ruby/tags.c     | 54 ++++------------------------------------
 bindings/ruby/thread.c   |  2 +-
 7 files changed, 10 insertions(+), 72 deletions(-)

-- 
2.39.2.13.g1fb56cf030

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-02 23:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22 23:43 [PATCH 0/3] ruby: get rid of Tags object Felipe Contreras
2023-03-22 23:43 ` [PATCH 1/3] ruby: add tags helper Felipe Contreras
2023-03-22 23:43 ` [PATCH 2/3] ruby: tags: return string array directly Felipe Contreras
2023-03-22 23:43 ` [PATCH 3/3] ruby: remove Tags object Felipe Contreras
2023-04-02 22:18 ` [PATCH 0/3] ruby: get rid of " David Bremner
2023-04-02 23:06   ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).