Reduce redundant code of prevector and speed it up
Reduce redundant code of prevector and speed it up

In prevector.h, the code which like item_ptr(size()) apears in the loop.
Both item_ptr() and size() judge whether values are held directly or
indirectly, but in most cases it is sufficient to make that judgement
once outside the loop.

This PR adds 2 private function fill() which has the loop to initialize
by specified value (or iterator of the other prevector's element),
but don't call item_ptr() in their loop.
Other functions(assign(), constructor, operator=(), insert())
that has similar loop, call fill() instead of original loop.

Also, resize() was changed like fill(), but it calls the default
constructor for that element each time.

stamhe/bitcoin,ElementsProject/elements,droark/bitcoin,rnicoll/dogecoin,kallewoof/bitcoin,tjps/bitcoin,bespike/litecoin,GroestlCoin/GroestlCoin,kazcw/bitcoin,jamesob/bitcoin,practicalswift/bitcoin,dscotese/bitcoin,ahmedbodi/vertcoin,midnightmagic/bitcoin,alecalve/bitcoin,nikkitan/bitcoin,monacoinproject/monacoin,GroestlCoin/bitcoin,namecoin/namecore,Sjors/bitcoin,r8921039/bitcoin,jambolo/bitcoin,midnightmagic/bitcoin,namecoin/namecoin-core,fujicoin/fujicoin,FeatherCoin/Feathercoin,lbryio/lbrycrd,pataquets/namecoin-core,Bushstar/UFO-Project,jonasschnelli/bitcoin,r8921039/bitcoin,namecoin/namecoin-core,digibyte/digibyte,sebrandon1/bitcoin,alecalve/bitcoin,EthanHeilman/bitcoin,OmniLayer/omnicore,apoelstra/bitcoin,pstratem/bitcoin,fanquake/bitcoin,Christewart/bitcoin,rnicoll/bitcoin,ElementsProject/elements,Christewart/bitcoin,donaloconnor/bitcoin,achow101/bitcoin,instagibbs/bitcoin,lateminer/bitcoin,lateminer/bitcoin,bespike/litecoin,bitcoinknots/bitcoin,lateminer/bitcoin,GroestlCoin/bitcoin,jlopp/statoshi,particl/particl-core,DigitalPandacoin/pandacoin,cdecker/bitcoin,kazcw/bitcoin,BTCGPU/BTCGPU,peercoin/peercoin,rawodb/bitcoin,practicalswift/bitcoin,Kogser/bitcoin,kallewoof/bitcoin,kallewoof/bitcoin,fanquake/bitcoin,myriadteam/myriadcoin,thrasher-/litecoin,pstratem/bitcoin,pstratem/bitcoin,tecnovert/particl-core,jmcorgan/bitcoin,n1bor/bitcoin,n1bor/bitcoin,Xekyo/bitcoin,dscotese/bitcoin,r8921039/bitcoin,AkioNak/bitcoin,guncoin/guncoin,joshrabinowitz/bitcoin,tjps/bitcoin,alecalve/bitcoin,bitcoinknots/bitcoin,DigitalPandacoin/pandacoin,Bushstar/UFO-Project,r8921039/bitcoin,jamesob/bitcoin,vmp32k/litecoin,GroestlCoin/GroestlCoin,MarcoFalke/bitcoin,mitchellcash/bitcoin,randy-waterhouse/bitcoin,mruddy/bitcoin,vertcoin/vertcoin,jamesob/bitcoin,achow101/bitcoin,apoelstra/bitcoin,JeremyRubin/bitcoin,tecnovert/particl-core,pataquets/namecoin-core,GroestlCoin/bitcoin,bespike/litecoin,jmcorgan/bitcoin,litecoin-project/litecoin,Sjors/bitcoin,jamesob/bitcoin,pstratem/bitcoin,h4x3rotab/BTCGPU,mitchellcash/bitcoin,JeremyRubin/bitcoin,tjps/bitcoin,particl/particl-core,jmcorgan/bitcoin,mruddy/bitcoin,jnewbery/bitcoin,GroestlCoin/bitcoin,alecalve/bitcoin,myriadteam/myriadcoin,monacoinproject/monacoin,fujicoin/fujicoin,OmniLayer/omnicore,AkioNak/bitcoin,nikkitan/bitcoin,kazcw/bitcoin,particl/particl-core,EthanHeilman/bitcoin,JeremyRubin/bitcoin,anditto/bitcoin,digibyte/digibyte,Kogser/bitcoin,yenliangl/bitcoin,jnewbery/bitcoin,paveljanik/bitcoin,GlobalBoost/GlobalBoost,kallewoof/bitcoin,rnicoll/bitcoin,domob1812/namecore,bespike/litecoin,qtumproject/qtum,Kogser/bitcoin,Kogser/bitcoin,prusnak/bitcoin,cdecker/bitcoin,donaloconnor/bitcoin,MarcoFalke/bitcoin,thrasher-/litecoin,Sjors/bitcoin,Kogser/bitcoin,vertcoin/vertcoin,joshrabinowitz/bitcoin,thrasher-/litecoin,ElementsProject/elements,FeatherCoin/Feathercoin,MarcoFalke/bitcoin,bitcoinknots/bitcoin,andreaskern/bitcoin,prusnak/bitcoin,gjhiggins/vcoincore,h4x3rotab/BTCGPU,n1bor/bitcoin,jlopp/statoshi,BTCGPU/BTCGPU,lbryio/lbrycrd,ajtowns/bitcoin,n1bor/bitcoin,bitcoin/bitcoin,jmcorgan/bitcoin,paveljanik/bitcoin,afk11/bitcoin,paveljanik/bitcoin,bitcoinsSG/bitcoin,h4x3rotab/BTCGPU,myriadcoin/myriadcoin,domob1812/huntercore,sebrandon1/bitcoin,sipsorcery/bitcoin,DigitalPandacoin/pandacoin,bitcoinsSG/bitcoin,namecoin/namecore,jtimon/bitcoin,MeshCollider/bitcoin,droark/bitcoin,jambolo/bitcoin,joshrabinowitz/bitcoin,namecoin/namecore,JeremyRubin/bitcoin,untrustbank/litecoin,peercoin/peercoin,DigitalPandacoin/pandacoin,stamhe/bitcoin,AkioNak/bitcoin,vertcoin/vertcoin,domob1812/bitcoin,RHavar/bitcoin,ElementsProject/elements,FeatherCoin/Feathercoin,jnewbery/bitcoin,guncoin/guncoin,jambolo/bitcoin,prusnak/bitcoin,OmniLayer/omnicore,yenliangl/bitcoin,prusnak/bitcoin,donaloconnor/bitcoin,anditto/bitcoin,kazcw/bitcoin,sstone/bitcoin,GroestlCoin/GroestlCoin,n1bor/bitcoin,particl/particl-core,mitchellcash/bitcoin,bespike/litecoin,domob1812/namecore,DigitalPandacoin/pandacoin,dscotese/bitcoin,mm-s/bitcoin,instagibbs/bitcoin,randy-waterhouse/bitcoin,andreaskern/bitcoin,peercoin/peercoin,n1bor/bitcoin,tecnovert/particl-core,Kogser/bitcoin,kazcw/bitcoin,BTCGPU/BTCGPU,lateminer/bitcoin,guncoin/guncoin,rawodb/bitcoin,anditto/bitcoin,sipsorcery/bitcoin,gjhiggins/vcoincore,bitcoinsSG/bitcoin,bitcoinknots/bitcoin,RHavar/bitcoin,jtimon/bitcoin,andreaskern/bitcoin,pataquets/namecoin-core,GlobalBoost/GlobalBoost,JeremyRubin/bitcoin,fujicoin/fujicoin,GroestlCoin/GroestlCoin,gjhiggins/vcoincore,jtimon/bitcoin,jmcorgan/bitcoin,mm-s/bitcoin,fujicoin/fujicoin,domob1812/bitcoin,jnewbery/bitcoin,ahmedbodi/vertcoin,GlobalBoost/GlobalBoost,namecoin/namecoin-core,lbryio/lbrycrd,ahmedbodi/vertcoin,jlopp/statoshi,BTCGPU/BTCGPU,BTCGPU/BTCGPU,ajtowns/bitcoin,lateminer/bitcoin,ericshawlinux/bitcoin,sebrandon1/bitcoin,domob1812/huntercore,andreaskern/bitcoin,ericshawlinux/bitcoin,Christewart/bitcoin,bitcoin/bitcoin,kazcw/bitcoin,RHavar/bitcoin,stamhe/bitcoin,MarcoFalke/bitcoin,nikkitan/bitcoin,monacoinproject/monacoin,Christewart/bitcoin,stamhe/bitcoin,r8921039/bitcoin,ajtowns/bitcoin,qtumproject/qtum,EthanHeilman/bitcoin,vertcoin/vertcoin,wellenreiter01/Feathercoin,domob1812/huntercore,prusnak/bitcoin,mitchellcash/bitcoin,GlobalBoost/GlobalBoost,achow101/bitcoin,nikkitan/bitcoin,GroestlCoin/bitcoin,cdecker/bitcoin,fanquake/bitcoin,rnicoll/dogecoin,paveljanik/bitcoin,litecoin-project/litecoin,tjps/bitcoin,anditto/bitcoin,digibyte/digibyte,afk11/bitcoin,rawodb/bitcoin,Kogser/bitcoin,domob1812/huntercore,lbryio/lbrycrd,GlobalBoost/GlobalBoost,ahmedbodi/vertcoin,FeatherCoin/Feathercoin,vertcoin/vertcoin,droark/bitcoin,randy-waterhouse/bitcoin,myriadteam/myriadcoin,afk11/bitcoin,litecoin-project/litecoin,instagibbs/bitcoin,lbryio/lbrycrd,untrustbank/litecoin,digibyte/digibyte,cdecker/bitcoin,jonasschnelli/bitcoin,untrustbank/litecoin,practicalswift/bitcoin,cdecker/bitcoin,vertcoin/vertcoin,OmniLayer/omnicore,domob1812/huntercore,mm-s/bitcoin,guncoin/guncoin,apoelstra/bitcoin,yenliangl/bitcoin,dscotese/bitcoin,mm-s/bitcoin,Bushstar/UFO-Project,DigitalPandacoin/pandacoin,sstone/bitcoin,peercoin/peercoin,EthanHeilman/bitcoin,wellenreiter01/Feathercoin,TheBlueMatt/bitcoin,andreaskern/bitcoin,yenliangl/bitcoin,bitcoin/bitcoin,stamhe/bitcoin,vmp32k/litecoin,tjps/bitcoin,gjhiggins/vcoincore,mruddy/bitcoin,lateminer/bitcoin,randy-waterhouse/bitcoin,Bushstar/UFO-Project,Xekyo/bitcoin,instagibbs/bitcoin,sebrandon1/bitcoin,monacoinproject/monacoin,CryptArc/bitcoin,domob1812/namecore,fujicoin/fujicoin,apoelstra/bitcoin,joshrabinowitz/bitcoin,jlopp/statoshi,wellenreiter01/Feathercoin,RHavar/bitcoin,dscotese/bitcoin,Bushstar/UFO-Project,yenliangl/bitcoin,GlobalBoost/GlobalBoost,droark/bitcoin,domob1812/bitcoin,litecoin-project/litecoin,namecoin/namecore,sipsorcery/bitcoin,jnewbery/bitcoin,pataquets/namecoin-core,domob1812/namecore,sstone/bitcoin,Sjors/bitcoin,ericshawlinux/bitcoin,TheBlueMatt/bitcoin,nikkitan/bitcoin,mruddy/bitcoin,OmniLayer/omnicore,stamhe/bitcoin,namecoin/namecoin-core,jlopp/statoshi,vmp32k/litecoin,afk11/bitcoin,rnicoll/dogecoin,jonasschnelli/bitcoin,bitcoin/bitcoin,peercoin/peercoin,sipsorcery/bitcoin,paveljanik/bitcoin,jonasschnelli/bitcoin,untrustbank/litecoin,EthanHeilman/bitcoin,Xekyo/bitcoin,MeshCollider/bitcoin,namecoin/namecoin-core,peercoin/peercoin,myriadcoin/myriadcoin,CryptArc/bitcoin,Kogser/bitcoin,Kogser/bitcoin,MeshCollider/bitcoin,rawodb/bitcoin,TheBlueMatt/bitcoin,GlobalBoost/GlobalBoost,vmp32k/litecoin,FeatherCoin/Feathercoin,untrustbank/litecoin,r8921039/bitcoin,rnicoll/bitcoin,h4x3rotab/BTCGPU,thrasher-/litecoin,achow101/bitcoin,anditto/bitcoin,jonasschnelli/bitcoin,sebrandon1/bitcoin,rnicoll/dogecoin,Bushstar/UFO-Project,ElementsProject/elements,vmp32k/litecoin,TheBlueMatt/bitcoin,Xekyo/bitcoin,rnicoll/bitcoin,Flowdalic/bitcoin,CryptArc/bitcoin,andreaskern/bitcoin,midnightmagic/bitcoin,midnightmagic/bitcoin,tecnovert/particl-core,randy-waterhouse/bitcoin,GroestlCoin/GroestlCoin,CryptArc/bitcoin,apoelstra/bitcoin,vmp32k/litecoin,apoelstra/bitcoin,mruddy/bitcoin,ericshawlinux/bitcoin,achow101/bitcoin,domob1812/bitcoin,CryptArc/bitcoin,alecalve/bitcoin,rnicoll/bitcoin,practicalswift/bitcoin,particl/particl-core,GroestlCoin/GroestlCoin,MarcoFalke/bitcoin,lbryio/lbrycrd,practicalswift/bitcoin,BTCGPU/BTCGPU,litecoin-project/litecoin,myriadcoin/myriadcoin,jamesob/bitcoin,bitcoinsSG/bitcoin,Christewart/bitcoin,gjhiggins/vcoincore,namecoin/namecoin-core,wellenreiter01/Feathercoin,myriadcoin/myriadcoin,AkioNak/bitcoin,mm-s/bitcoin,RHavar/bitcoin,bitcoin/bitcoin,bitcoin/bitcoin,ericshawlinux/bitcoin,bitcoinsSG/bitcoin,OmniLayer/omnicore,qtumproject/qtum,dscotese/bitcoin,bitcoinsSG/bitcoin,jtimon/bitcoin,domob1812/namecore,droark/bitcoin,AkioNak/bitcoin,digibyte/digibyte,fujicoin/fujicoin,jambolo/bitcoin,Kogser/bitcoin,donaloconnor/bitcoin,randy-waterhouse/bitcoin,guncoin/guncoin,TheBlueMatt/bitcoin,myriadteam/myriadcoin,Flowdalic/bitcoin,digibyte/digibyte,namecoin/namecore,Kogser/bitcoin,ericshawlinux/bitcoin,wellenreiter01/Feathercoin,Flowdalic/bitcoin,pataquets/namecoin-core,bitcoinknots/bitcoin,wellenreiter01/Feathercoin,ajtowns/bitcoin,RHavar/bitcoin,monacoinproject/monacoin,ajtowns/bitcoin,Flowdalic/bitcoin,kallewoof/bitcoin,alecalve/bitcoin,jtimon/bitcoin,rawodb/bitcoin,MarcoFalke/bitcoin,yenliangl/bitcoin,monacoinproject/monacoin,thrasher-/litecoin,instagibbs/bitcoin,namecoin/namecore,gjhiggins/vcoincore,bespike/litecoin,Flowdalic/bitcoin,mitchellcash/bitcoin,pstratem/bitcoin,jmcorgan/bitcoin,sstone/bitcoin,fanquake/bitcoin,midnightmagic/bitcoin,ElementsProject/elements,mruddy/bitcoin,jambolo/bitcoin,particl/particl-core,EthanHeilman/bitcoin,achow101/bitcoin,sipsorcery/bitcoin,ahmedbodi/vertcoin,nikkitan/bitcoin,kallewoof/bitcoin,Flowdalic/bitcoin,mm-s/bitcoin,Xekyo/bitcoin,thrasher-/litecoin,guncoin/guncoin,joshrabinowitz/bitcoin,tjps/bitcoin,jamesob/bitcoin,untrustbank/litecoin,ahmedbodi/vertcoin,donaloconnor/bitcoin,midnightmagic/bitcoin,myriadcoin/myriadcoin,Kogser/bitcoin,lbryio/lbrycrd,sstone/bitcoin,practicalswift/bitcoin,paveljanik/bitcoin,qtumproject/qtum,JeremyRubin/bitcoin,rawodb/bitcoin,cdecker/bitcoin,mitchellcash/bitcoin,MeshCollider/bitcoin,pataquets/namecoin-core,pstratem/bitcoin,droark/bitcoin,qtumproject/qtum,instagibbs/bitcoin,MeshCollider/bitcoin,FeatherCoin/Feathercoin,joshrabinowitz/bitcoin,domob1812/namecore,qtumproject/qtum,Christewart/bitcoin,sstone/bitcoin,CryptArc/bitcoin,jambolo/bitcoin,myriadteam/myriadcoin,qtumproject/qtum,Xekyo/bitcoin,rnicoll/dogecoin,anditto/bitcoin,rnicoll/bitcoin,jtimon/bitcoin,tecnovert/particl-core,donaloconnor/bitcoin,domob1812/bitcoin,myriadteam/myriadcoin,domob1812/huntercore,TheBlueMatt/bitcoin,fanquake/bitcoin,fanquake/bitcoin,jlopp/statoshi,sipsorcery/bitcoin,litecoin-project/litecoin,prusnak/bitcoin,Sjors/bitcoin,MeshCollider/bitcoin,domob1812/bitcoin,tecnovert/particl-core,GroestlCoin/bitcoin,myriadcoin/myriadcoin,afk11/bitcoin,afk11/bitcoin,AkioNak/bitcoin,ajtowns/bitcoin,h4x3rotab/BTCGPU,h4x3rotab/BTCGPU,sebrandon1/bitcoin