Rewrite Uri.CheckForUnicode to improve throughput and reduce allocations
Rewrite Uri.CheckForUnicode to improve throughput and reduce allocations

Every call to this is allocating a new char[], unencoding into that array, and then iterating through the array looking for non-ASCII chars.  We can simplify all of that to avoid needing to store the results into the destination.  This avoids the allocation, the copy, and a second iteration through the results.  It also lets us bail early if we do fine unicode characters.  All tested scenarios get significantly faster.

mmitche/corefx,Ermiar/corefx,parjong/corefx,Jiayili1/corefx,mmitche/corefx,stone-li/corefx,dotnet-bot/corefx,nchikanov/corefx,mmitche/corefx,ravimeda/corefx,Ermiar/corefx,weltkante/corefx,gkhanna79/corefx,wtgodbe/corefx,rahku/corefx,alexperovich/corefx,BrennanConroy/corefx,jlin177/corefx,dhoehna/corefx,stephenmichaelf/corefx,gkhanna79/corefx,cydhaselton/corefx,ravimeda/corefx,jlin177/corefx,zhenlan/corefx,ViktorHofer/corefx,lggomez/corefx,twsouthwick/corefx,rahku/corefx,seanshpark/corefx,parjong/corefx,DnlHarvey/corefx,Jiayili1/corefx,gkhanna79/corefx,richlander/corefx,ptoonen/corefx,richlander/corefx,JosephTremoulet/corefx,parjong/corefx,rjxby/corefx,fgreinacher/corefx,ViktorHofer/corefx,ptoonen/corefx,yizhang82/corefx,JosephTremoulet/corefx,DnlHarvey/corefx,rjxby/corefx,marksmeltzer/corefx,wtgodbe/corefx,axelheer/corefx,the-dwyer/corefx,mmitche/corefx,mmitche/corefx,nchikanov/corefx,the-dwyer/corefx,JosephTremoulet/corefx,rahku/corefx,cydhaselton/corefx,rahku/corefx,nbarbettini/corefx,nbarbettini/corefx,zhenlan/corefx,richlander/corefx,stone-li/corefx,seanshpark/corefx,axelheer/corefx,billwert/corefx,dhoehna/corefx,Jiayili1/corefx,wtgodbe/corefx,YoupHulsebos/corefx,krytarowski/corefx,wtgodbe/corefx,nchikanov/corefx,alexperovich/corefx,Jiayili1/corefx,BrennanConroy/corefx,richlander/corefx,MaggieTsang/corefx,jlin177/corefx,nbarbettini/corefx,krk/corefx,zhenlan/corefx,Jiayili1/corefx,lggomez/corefx,krytarowski/corefx,Petermarcu/corefx,seanshpark/corefx,Petermarcu/corefx,tijoytom/corefx,weltkante/corefx,parjong/corefx,ravimeda/corefx,ptoonen/corefx,Petermarcu/corefx,elijah6/corefx,yizhang82/corefx,parjong/corefx,krytarowski/corefx,marksmeltzer/corefx,elijah6/corefx,seanshpark/corefx,krk/corefx,jlin177/corefx,billwert/corefx,DnlHarvey/corefx,ravimeda/corefx,weltkante/corefx,elijah6/corefx,dotnet-bot/corefx,ViktorHofer/corefx,nchikanov/corefx,gkhanna79/corefx,shimingsg/corefx,ptoonen/corefx,twsouthwick/corefx,lggomez/corefx,krk/corefx,zhenlan/corefx,billwert/corefx,JosephTremoulet/corefx,mazong1123/corefx,DnlHarvey/corefx,mazong1123/corefx,Petermarcu/corefx,dotnet-bot/corefx,YoupHulsebos/corefx,Ermiar/corefx,rubo/corefx,fgreinacher/corefx,stone-li/corefx,MaggieTsang/corefx,rahku/corefx,cydhaselton/corefx,lggomez/corefx,lggomez/corefx,the-dwyer/corefx,yizhang82/corefx,MaggieTsang/corefx,krk/corefx,weltkante/corefx,zhenlan/corefx,twsouthwick/corefx,rubo/corefx,YoupHulsebos/corefx,ptoonen/corefx,rahku/corefx,nbarbettini/corefx,the-dwyer/corefx,MaggieTsang/corefx,zhenlan/corefx,lggomez/corefx,alexperovich/corefx,nchikanov/corefx,axelheer/corefx,weltkante/corefx,MaggieTsang/corefx,Jiayili1/corefx,dhoehna/corefx,stephenmichaelf/corefx,shimingsg/corefx,YoupHulsebos/corefx,ViktorHofer/corefx,ravimeda/corefx,ericstj/corefx,seanshpark/corefx,krk/corefx,rubo/corefx,twsouthwick/corefx,dotnet-bot/corefx,the-dwyer/corefx,mmitche/corefx,tijoytom/corefx,stephenmichaelf/corefx,billwert/corefx,marksmeltzer/corefx,stone-li/corefx,twsouthwick/corefx,Ermiar/corefx,tijoytom/corefx,Petermarcu/corefx,fgreinacher/corefx,jlin177/corefx,mazong1123/corefx,mazong1123/corefx,krytarowski/corefx,the-dwyer/corefx,weltkante/corefx,tijoytom/corefx,billwert/corefx,weltkante/corefx,krk/corefx,stephenmichaelf/corefx,elijah6/corefx,ViktorHofer/corefx,shimingsg/corefx,gkhanna79/corefx,gkhanna79/corefx,DnlHarvey/corefx,wtgodbe/corefx,marksmeltzer/corefx,yizhang82/corefx,elijah6/corefx,nchikanov/corefx,fgreinacher/corefx,seanshpark/corefx,jlin177/corefx,alexperovich/corefx,parjong/corefx,ericstj/corefx,YoupHulsebos/corefx,ericstj/corefx,rjxby/corefx,ericstj/corefx,tijoytom/corefx,zhenlan/corefx,wtgodbe/corefx,krytarowski/corefx,krk/corefx,dhoehna/corefx,YoupHulsebos/corefx,jlin177/corefx,billwert/corefx,ptoonen/corefx,stone-li/corefx,the-dwyer/corefx,Jiayili1/corefx,axelheer/corefx,marksmeltzer/corefx,lggomez/corefx,yizhang82/corefx,ViktorHofer/corefx,richlander/corefx,mazong1123/corefx,dotnet-bot/corefx,rubo/corefx,JosephTremoulet/corefx,krytarowski/corefx,nbarbettini/corefx,cydhaselton/corefx,rahku/corefx,elijah6/corefx,alexperovich/corefx,ptoonen/corefx,DnlHarvey/corefx,rjxby/corefx,rubo/corefx,yizhang82/corefx,tijoytom/corefx,shimingsg/corefx,BrennanConroy/corefx,stephenmichaelf/corefx,rjxby/corefx,mazong1123/corefx,stone-li/corefx,shimingsg/corefx,marksmeltzer/corefx,tijoytom/corefx,stephenmichaelf/corefx,dhoehna/corefx,nchikanov/corefx,alexperovich/corefx,rjxby/corefx,alexperovich/corefx,krytarowski/corefx,ravimeda/corefx,JosephTremoulet/corefx,twsouthwick/corefx,Ermiar/corefx,yizhang82/corefx,shimingsg/corefx,Petermarcu/corefx,axelheer/corefx,axelheer/corefx,richlander/corefx,wtgodbe/corefx,mazong1123/corefx,richlander/corefx,dotnet-bot/corefx,dhoehna/corefx,Ermiar/corefx,cydhaselton/corefx,nbarbettini/corefx,YoupHulsebos/corefx,dhoehna/corefx,rjxby/corefx,ravimeda/corefx,MaggieTsang/corefx,nbarbettini/corefx,cydhaselton/corefx,shimingsg/corefx,twsouthwick/corefx,stone-li/corefx,mmitche/corefx,JosephTremoulet/corefx,marksmeltzer/corefx,seanshpark/corefx,cydhaselton/corefx,Ermiar/corefx,Petermarcu/corefx,parjong/corefx,ericstj/corefx,elijah6/corefx,gkhanna79/corefx,ViktorHofer/corefx,DnlHarvey/corefx,stephenmichaelf/corefx,ericstj/corefx,billwert/corefx,dotnet-bot/corefx,ericstj/corefx,MaggieTsang/corefx