From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 1 Mar 2019 01:04:12 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH 1/1] salad: fix mhash 'random' method Message-ID: <20190228220412.GC17469@chai> References: <5f5c5a5994698deef183a31f46e8efaa9f4cd399.1551389056.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f5c5a5994698deef183a31f46e8efaa9f4cd399.1551389056.git.v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com List-ID: * Vladislav Shpilevoy [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. OK to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov