From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0Mz/Er2SG2Q+zQAASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 00:43:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4OrCEr2SG2S2RQEAauVa8A (envelope-from ) for ; Thu, 23 Mar 2023 00:43:57 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A6D00D4A8 for ; Thu, 23 Mar 2023 00:43:56 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id F2E675F6B6; Wed, 22 Mar 2023 23:43:52 +0000 (UTC) Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by mail.notmuchmail.org (Postfix) with ESMTPS id 368985F3E7 for ; Wed, 22 Mar 2023 23:43:50 +0000 (UTC) Received: by mail-oo1-xc32.google.com with SMTP id v14-20020a4ae6ce000000b0053b91ae6552so52437oot.8 for ; Wed, 22 Mar 2023 16:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679528628; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=z36wc3an1Nf8Vd5kxsAysqTEbX+rTbqK4bNlukzUOhs=; b=keYXUWo/z5TjZHMyXdbekaiXyAgt8GTAa1gbh2+iUQh8v0P+wvnrrhbyyoOuFuZSeN KrhG7RPBySuJl0SsAUfQ4QO9TrKvQhmXuyWCehP/rYyZU6sQSvefbOewjZPUKNRYkZkr oHNtaVNsnrhAOQuwEjKEdMgFdXbySWxGcKibVg44wJgF3XzsqVknHzggbF3L2W+l5VKb yaps3JwWK/MC0suZRwFMMAMWtQgbDR0pQ0ERn9I5ZySHC0qKIHHR1ZQhy5rkBa+t6xeE Hvp6fHe/egwLspSsP7afVmdyWq/fcQLsRG7YUNcfhFCEA6z9TtNu+afqVrF2a3RAozXL OZMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679528628; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z36wc3an1Nf8Vd5kxsAysqTEbX+rTbqK4bNlukzUOhs=; b=XFdBqGFWInSpIf7MRygvsJv9GolMx98zF/yDbicn8iZl5bRWJj1PP1WMLomMeNm9SU cVN86T7/9okeIDWg0AFYfGttOPgtTqEl6D3CDZaQayx2WwYShfMqJTA1LsPAvXHfiBPz +LGUjzGCBrMVcZ3uMIQIWT/Nx3ZdbnmyETRpYz2S5Sg4LTlkEP6y9usstj1p9KXJevrr nG5PTcaheE1PEkhjVpglJzqvhc18F9bWn8dt8isS91AX6B0EMZmTJAVcyGOXQCE9a96H UC193TjFZ/aL+ODxLql7hU+UrKyATvOsKm267DWKSZye3HYnBhyetEMFUy8GyqnCNzXz TZXw== X-Gm-Message-State: AO0yUKU8955/v1UHU/+1K7IxyV2wYs5pMqQaE7BNLw7nvEVbdTMlg30S vzmsHG49E0HrrKUpPnv2TGFFmdzIvSU= X-Google-Smtp-Source: AK7set9JEbHfgaVIo9f+9vRMOKwuQoVq4b8fWdPYVYyolcgtf8drF5eElyePMt4skS6JnAn4/DFmHg== X-Received: by 2002:a4a:ac0f:0:b0:51a:6ea9:5053 with SMTP id p15-20020a4aac0f000000b0051a6ea95053mr2467362oon.9.1679528628521; Wed, 22 Mar 2023 16:43:48 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id v13-20020a9d5a0d000000b00693c9f984b4sm6884020oth.70.2023.03.22.16.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 16:43:47 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 0/3] ruby: get rid of Tags object Date: Wed, 22 Mar 2023 17:43:43 -0600 Message-Id: <20230322234346.70537-1-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 MIME-Version: 1.0 Message-ID-Hash: ZJ57SEUQMFPOZPZADNFEDIHZ7OOOSHRN X-Message-ID-Hash: ZJ57SEUQMFPOZPZADNFEDIHZ7OOOSHRN X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: arcnmx X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679528637; a=rsa-sha256; cv=none; b=abRQZrizC9NY8V3L/5j3+mHfOayrbXI+lan44DCVE5qb+qxKE2+XS2UH2f9sGVGNJAhKEE 6Jn7Zuz9QliILSQ+Rm0U4JXDx9knCWT+DiN4EwE5rTSeH9k9LpYSpGo5P/UQpUmyGWBvZP pwY+v+TsVgYp2MIvQeFfaZ0sknuXQsSAQb6SFTSGji5hxV+ezW4AgtoB14sbt3TUySjsuC yQHWJTClKKCK9zpCWW5c4tTOd9RNmOBBGyR7q0goSl42V5lVnxbGWwimvQKLW2gzcI64LL vS4qiHwDzfhHMneG/uxn0OvjUse6KhRfs9NQu5YEGGS2umtygMMrHiGFwWygGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b="keYXUWo/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679528637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Su0XQCs6P4K6rjEA1G0pQ9XWsPvYufTgaPA9ZxAjVrY=; b=DH8+e1RGaDNAN1OJKJcW5co7zi/AoGNsvzztSgM4B89NSjOI+Pm/+6VG523M3DTyJXNCJM 5FQbE/Vwrjb7SYrRH/PpUOdL42BAr3Ere5ZCmwtWIQ7ssum+D/Ud3OsXyrot6k2fvkX8qU uv9PGJn+vCA7y9OSSN448rLivSleCeJBbyBEcl+OU3iqRnnrey0S1nhFMNPfTmBdiVhhQO yNkm2zuiofm68kOAqq0b1i4h3QS1nVlwbA2XxrtUSnM+WH2aNgnjl4EGCklGclzIz7XZdA obcEbjeZZnkYLsnZfdllYLSN3tyDhsc/GrlJ8jAEphoWPpLOaWjuUdOEI/+vLg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b="keYXUWo/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.37 X-Spam-Score: 0.37 X-Migadu-Queue-Id: A6D00D4A8 X-TUID: Ab0BrLBKKt9/ 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