Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redundant/replicated code line in gdk/gdk_hash.c #6950

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

redundant/replicated code line in gdk/gdk_hash.c #6950

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working GDK Kernel major

Comments

@monetdb-team
Copy link

Date: 2020-08-17 23:56:02 +0200
From: @drstmane
To: GDK devs <>
Version: 11.37.11 (Jun2020-SP1)

Last updated: 2020-10-19 11:06:20 +0200

Comment 27987

Date: 2020-08-17 23:56:02 +0200
From: @drstmane

Created attachment 690
patch to remove redundant code line

IMHO, there is a redundant/replicated code line in macro finishhash() in gdk/gdk_hash.c (lines 686 & 687 are identical):

$ grep -n4 'c = hash_TYPE(h, v + o - b->hseqbase);' gdk/gdk_hash.c
657-define starthash(TYPE)
658- do {
659- const TYPE *restrict v = (const TYPE ) BUNtloc(bi, 0);
660- for (; p < cnt1; p++) {
661: c = hash_TYPE(h, v + o - b->hseqbase);
662- hget = HASHget(h, c);
663- if (hget == hnil) {
664- if (h->nheads == maxslots)
665- break; /
mask too full */ \

682-define finishhash(TYPE)
683- do {
684- const TYPE *restrict v = (const TYPE *) BUNtloc(bi, 0);
685- for (; p < ci->ncand; p++) {
686: c = hash_TYPE(h, v + o - b->hseqbase);
687: c = hash_TYPE(h, v + o - b->hseqbase);
688- hget = HASHget(h, c);
689- h->nheads += hget == hnil;
690- for (hb = hget;
691- hb != hnil; \

Apparently, this replicated line sneaked-in with changeset edd0e661b477 on branch candidate-exceptions on Thu, 01 Aug 2019; cf.,

https://dev.monetdb.org/hg/MonetDB/rev/edd0e661b477

If indeed redundant, a potential patch is attached.

Attached file: gdh_hash.c-finishhash-remove-redundant-line.patch (text/plain, 445 bytes)
Description: patch to remove redundant code line

Comment 27991

Date: 2020-08-18 16:52:54 +0200
From: @sjoerdmullender

Fixed in changeset 8f1c162d0237

@monetdb-team monetdb-team added bug Something isn't working GDK Kernel major labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GDK Kernel major
Projects
None yet
Development

No branches or pull requests

2 participants