> What could be much worse is that stuffing code into the if-block > bloats the code so much as to frustrate lookahead I-stream caching > of the normal "branch taken and return 0" path: > > if (mp->ma_used > n_used && mp->ma_fill*3 >= (mp->ma_mask+1)*2) { > if (dictresize(mp, mp->ma_used*2) != 0) > return -1; > } > return 0; > > Rewriting as > > if (mp->ma_used <= n_used || mp->ma_fill*3 < (mp->ma_mask+1)*2) > return 0; > > return dictresize(mp, mp->ma_used*2) ? -1 : 0; That last line might as well be return dictresize(mp, mp->ma_used*2); /* Or *4, per Raymond */ Which reminds me, there are two other places where dictresize() is called; shouldn't those be changed to the new fill factor? All in ll I think I'm mildly in favor of this change. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4