From: Lars-Erik Bjørk Date: June 30 2009 6:19pm Subject: Re: IndexRootPage::splitIndexPage List-Archive: http://lists.mysql.com/falcon/776 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; delsp=yes; format=flowed; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Then I will change it :) Thanks for looking at it! /Lars-Erik On Jun 30, 2009, at 6:01 PM, Kevin Lewis wrote: > LarsErik, > > Yes, your analysis seems to be correct in that the return true is a= =20 > catch22 that cannot happen. It will only return true if the =20 > recursive call returns true. > > Lars-Erik Bj=F8rk wrote: >> Hi all! >> I have been looking at indexRootPage::splitIndexPage, and a small = =20 >> part of it seems a little strange to me. It will not provoke a bug= , =20 >> but it is confusing when reading it. >> The method is declared to return a bool. When splitting an index = =20 >> page, the method will recursively call itself if the parent page = =20 >> also needs to be split. The recursion will stop when the parent = =20 >> page does not need to be split, or the root page is split. In this= =20 >> case, it will return false. >> The recursion looks like this >> ... >> if (splitIndexPage (dbb, indexId, parentBdb, transId, result, = =20 >> &splitKey, >> splitPageNumber, (parentBdb-=20 >> >pageNumber =3D=3D rootPageNumber))) >> return true; >> ... >> However, this is the only place the method returns true, so =20 >> therefore it can actually never return true. >> The return value, which will always be false is also used in a = =20 >> branch in IndexRootPage::addIndexEntry. >> Do you agree with this? It is ok if I rewrite this to be a void = =20 >> method instead? It will improve the readability, and we will avoid= =20 >> the possibility that someone will use the return value in the futu= re. >> Best, >> Lars-Erik > > --=20 > Falcon Storage Engine Mailing List > For list archives: http://lists.mysql.com/falcon > To unsubscribe: http://lists.mysql.com/falcon?unsub=3Dlars-erik.= bjork@stripped >