From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Konstantin Osipov <kostja@tarantool.org> Cc: vdavydov.dev@gmail.com Subject: Re: [tarantool-patches] Re: [PATCH 1/1] salad: fix mhash 'random' method Date: Fri, 1 Mar 2019 12:40:43 +0300 [thread overview] Message-ID: <c1c9eed3-adb5-511c-65e4-44b6fc99b786@tarantool.org> (raw) In-Reply-To: <20190228220412.GC17469@chai> On 01/03/2019 01:04, Konstantin Osipov wrote: > * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/03/01 00:29]: >> - return h->n_buckets; >> + mh_int_t res = mh_next(h, rnd % mh_end(h)); >> + if (res != mh_end(h)) >> + return res; >> + return mh_first(h); > > > Well, it takes some time to understand this code. IMO, it is much better to encapsulate those 'for' loops scanning for an occupied non-dirty slot, than put them into each function, working with buckets array. > > OK to push. Pushed to 2.1. > > > -- > Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 > http://tarantool.io - www.twitter.com/kostja_osipov >
prev parent reply other threads:[~2019-03-01 9:40 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-28 21:25 Vladislav Shpilevoy 2019-02-28 22:04 ` [tarantool-patches] " Konstantin Osipov 2019-03-01 9:40 ` Vladislav Shpilevoy [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=c1c9eed3-adb5-511c-65e4-44b6fc99b786@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [tarantool-patches] Re: [PATCH 1/1] salad: fix mhash '\''random'\'' method' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox