From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1DC9C38303FA; Thu, 26 May 2022 20:53:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DC9C38303FA From: "mark at klomp dot org" To: bzip2-devel@sourceware.org Subject: =?UTF-8?B?W0J1ZyBiemlwMi8yODkwNF0gbGliYnppcDI6IOKAmGNvc3RbM10=?= =?UTF-8?B?4oCZIG1heSBiZSB1c2VkIHVuaW5pdGlhbGl6ZWQgaW4gdGhpcyBmdW5jdGlv?= =?UTF-8?B?biBbLVdtYXliZS11bmluaXRpYWxpemVkXQ==?= Date: Thu, 26 May 2022 20:53:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: bzip2 X-Bugzilla-Component: bzip2 X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: bzip2-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bzip2-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2022 20:53:45 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28904 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Mark Wielaard --- (In reply to demerphq from comment #3) > I am fine with both of your proposals. I was wondering why you don't > use memset() instead of the explicit loop? From what I understand it > is faster. I went with the second option. I am not using memset but let the compiler p= ick the most efficient way of initializing. With just 6 elements calling memcpy might just be extra overhead. Thanks for the report. commit 9de658d248f9fd304afa3321dd7a9de1280356ec Author: Mark Wielaard Date: Thu May 26 22:38:01 2022 +0200 Initialize the fave and cost arrays fully We try to be smart in sendMTFValues by initializing just nGroups number of elements instead of all BZ_N_GROUPS elements. But this means the compiler doesn't know all elements are correctly initialized and might warn. The arrays are really small, BZ_N_GROUPS, 6 elements. And nGroups =3D=3D BZ_N_GROUPS is the common case. So just initialize them = all always. Using a constant loop might also help the compiler to optimize the initialization. https://sourceware.org/bugzilla/show_bug.cgi?id=3D28904 --=20 You are receiving this mail because: You are on the CC list for the bug.=