fast-path.generated.go 216 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197
  1. // +build !notfastpath
  2. // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
  3. // Use of this source code is governed by a MIT license found in the LICENSE file.
  4. // Code generated from fast-path.go.tmpl - DO NOT EDIT.
  5. package codec
  6. // Fast path functions try to create a fast path encode or decode implementation
  7. // for common maps and slices.
  8. //
  9. // We define the functions and register them in this single file
  10. // so as not to pollute the encode.go and decode.go, and create a dependency in there.
  11. // This file can be omitted without causing a build failure.
  12. //
  13. // The advantage of fast paths is:
  14. // - Many calls bypass reflection altogether
  15. //
  16. // Currently support
  17. // - slice of all builtin types (numeric, bool, string, []byte)
  18. // - maps of builtin types to builtin or interface{} type, EXCEPT FOR
  19. // keys of type uintptr, int8/16/32, uint16/32, float32/64, bool, interface{}
  20. // AND values of type type int8/16/32, uint16/32
  21. // This should provide adequate "typical" implementations.
  22. //
  23. // Note that fast track decode functions must handle values for which an address cannot be obtained.
  24. // For example:
  25. // m2 := map[string]int{}
  26. // p2 := []interface{}{m2}
  27. // // decoding into p2 will bomb if fast track functions do not treat like unaddressable.
  28. //
  29. import (
  30. "reflect"
  31. "sort"
  32. )
  33. const fastpathEnabled = true
  34. const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v"
  35. type fastpathT struct{}
  36. var fastpathTV fastpathT
  37. type fastpathE struct {
  38. rtid uintptr
  39. rt reflect.Type
  40. encfn func(*Encoder, *codecFnInfo, reflect.Value)
  41. decfn func(*Decoder, *codecFnInfo, reflect.Value)
  42. }
  43. type fastpathA [81]fastpathE
  44. func (x *fastpathA) index(rtid uintptr) int {
  45. // use binary search to grab the index (adapted from sort/search.go)
  46. // Note: we use goto (instead of for loop) so this can be inlined.
  47. // h, i, j := 0, 0, len(x)
  48. var h, i uint
  49. var j = uint(len(x))
  50. LOOP:
  51. if i < j {
  52. h = i + (j-i)/2
  53. if x[h].rtid < rtid {
  54. i = h + 1
  55. } else {
  56. j = h
  57. }
  58. goto LOOP
  59. }
  60. if i < uint(len(x)) && x[i].rtid == rtid {
  61. return int(i)
  62. }
  63. return -1
  64. }
  65. type fastpathAslice []fastpathE
  66. func (x fastpathAslice) Len() int { return len(x) }
  67. func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid }
  68. func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] }
  69. var fastpathAV fastpathA
  70. // due to possible initialization loop error, make fastpath in an init()
  71. func init() {
  72. var i uint = 0
  73. fn := func(v interface{},
  74. fe func(*Encoder, *codecFnInfo, reflect.Value),
  75. fd func(*Decoder, *codecFnInfo, reflect.Value)) {
  76. xrt := reflect.TypeOf(v)
  77. xptr := rt2id(xrt)
  78. fastpathAV[i] = fastpathE{xptr, xrt, fe, fd}
  79. i++
  80. }
  81. fn([]interface{}(nil), (*Encoder).fastpathEncSliceIntfR, (*Decoder).fastpathDecSliceIntfR)
  82. fn([]string(nil), (*Encoder).fastpathEncSliceStringR, (*Decoder).fastpathDecSliceStringR)
  83. fn([][]byte(nil), (*Encoder).fastpathEncSliceBytesR, (*Decoder).fastpathDecSliceBytesR)
  84. fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R)
  85. fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R)
  86. fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR)
  87. fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R)
  88. fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R)
  89. fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R)
  90. fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR)
  91. fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R)
  92. fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R)
  93. fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R)
  94. fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R)
  95. fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR)
  96. fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR)
  97. fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR)
  98. fn(map[string][]byte(nil), (*Encoder).fastpathEncMapStringBytesR, (*Decoder).fastpathDecMapStringBytesR)
  99. fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR)
  100. fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R)
  101. fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R)
  102. fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR)
  103. fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R)
  104. fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R)
  105. fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R)
  106. fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR)
  107. fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR)
  108. fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR)
  109. fn(map[uint][]byte(nil), (*Encoder).fastpathEncMapUintBytesR, (*Decoder).fastpathDecMapUintBytesR)
  110. fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR)
  111. fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R)
  112. fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R)
  113. fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR)
  114. fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R)
  115. fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R)
  116. fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R)
  117. fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR)
  118. fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR)
  119. fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR)
  120. fn(map[uint8][]byte(nil), (*Encoder).fastpathEncMapUint8BytesR, (*Decoder).fastpathDecMapUint8BytesR)
  121. fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR)
  122. fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R)
  123. fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R)
  124. fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR)
  125. fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R)
  126. fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R)
  127. fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R)
  128. fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR)
  129. fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR)
  130. fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR)
  131. fn(map[uint64][]byte(nil), (*Encoder).fastpathEncMapUint64BytesR, (*Decoder).fastpathDecMapUint64BytesR)
  132. fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR)
  133. fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R)
  134. fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R)
  135. fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR)
  136. fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R)
  137. fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R)
  138. fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R)
  139. fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR)
  140. fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR)
  141. fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR)
  142. fn(map[int][]byte(nil), (*Encoder).fastpathEncMapIntBytesR, (*Decoder).fastpathDecMapIntBytesR)
  143. fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR)
  144. fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R)
  145. fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R)
  146. fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR)
  147. fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R)
  148. fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R)
  149. fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R)
  150. fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR)
  151. fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR)
  152. fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR)
  153. fn(map[int64][]byte(nil), (*Encoder).fastpathEncMapInt64BytesR, (*Decoder).fastpathDecMapInt64BytesR)
  154. fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR)
  155. fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R)
  156. fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R)
  157. fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR)
  158. fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R)
  159. fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R)
  160. fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R)
  161. fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR)
  162. sort.Sort(fastpathAslice(fastpathAV[:]))
  163. }
  164. // -- encode
  165. // -- -- fast path type switch
  166. func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
  167. switch v := iv.(type) {
  168. case []interface{}:
  169. fastpathTV.EncSliceIntfV(v, e)
  170. case *[]interface{}:
  171. fastpathTV.EncSliceIntfV(*v, e)
  172. case []string:
  173. fastpathTV.EncSliceStringV(v, e)
  174. case *[]string:
  175. fastpathTV.EncSliceStringV(*v, e)
  176. case [][]byte:
  177. fastpathTV.EncSliceBytesV(v, e)
  178. case *[][]byte:
  179. fastpathTV.EncSliceBytesV(*v, e)
  180. case []float32:
  181. fastpathTV.EncSliceFloat32V(v, e)
  182. case *[]float32:
  183. fastpathTV.EncSliceFloat32V(*v, e)
  184. case []float64:
  185. fastpathTV.EncSliceFloat64V(v, e)
  186. case *[]float64:
  187. fastpathTV.EncSliceFloat64V(*v, e)
  188. case []uint:
  189. fastpathTV.EncSliceUintV(v, e)
  190. case *[]uint:
  191. fastpathTV.EncSliceUintV(*v, e)
  192. case []uint16:
  193. fastpathTV.EncSliceUint16V(v, e)
  194. case *[]uint16:
  195. fastpathTV.EncSliceUint16V(*v, e)
  196. case []uint32:
  197. fastpathTV.EncSliceUint32V(v, e)
  198. case *[]uint32:
  199. fastpathTV.EncSliceUint32V(*v, e)
  200. case []uint64:
  201. fastpathTV.EncSliceUint64V(v, e)
  202. case *[]uint64:
  203. fastpathTV.EncSliceUint64V(*v, e)
  204. case []int:
  205. fastpathTV.EncSliceIntV(v, e)
  206. case *[]int:
  207. fastpathTV.EncSliceIntV(*v, e)
  208. case []int8:
  209. fastpathTV.EncSliceInt8V(v, e)
  210. case *[]int8:
  211. fastpathTV.EncSliceInt8V(*v, e)
  212. case []int16:
  213. fastpathTV.EncSliceInt16V(v, e)
  214. case *[]int16:
  215. fastpathTV.EncSliceInt16V(*v, e)
  216. case []int32:
  217. fastpathTV.EncSliceInt32V(v, e)
  218. case *[]int32:
  219. fastpathTV.EncSliceInt32V(*v, e)
  220. case []int64:
  221. fastpathTV.EncSliceInt64V(v, e)
  222. case *[]int64:
  223. fastpathTV.EncSliceInt64V(*v, e)
  224. case []bool:
  225. fastpathTV.EncSliceBoolV(v, e)
  226. case *[]bool:
  227. fastpathTV.EncSliceBoolV(*v, e)
  228. case map[string]interface{}:
  229. fastpathTV.EncMapStringIntfV(v, e)
  230. case *map[string]interface{}:
  231. fastpathTV.EncMapStringIntfV(*v, e)
  232. case map[string]string:
  233. fastpathTV.EncMapStringStringV(v, e)
  234. case *map[string]string:
  235. fastpathTV.EncMapStringStringV(*v, e)
  236. case map[string][]byte:
  237. fastpathTV.EncMapStringBytesV(v, e)
  238. case *map[string][]byte:
  239. fastpathTV.EncMapStringBytesV(*v, e)
  240. case map[string]uint:
  241. fastpathTV.EncMapStringUintV(v, e)
  242. case *map[string]uint:
  243. fastpathTV.EncMapStringUintV(*v, e)
  244. case map[string]uint8:
  245. fastpathTV.EncMapStringUint8V(v, e)
  246. case *map[string]uint8:
  247. fastpathTV.EncMapStringUint8V(*v, e)
  248. case map[string]uint64:
  249. fastpathTV.EncMapStringUint64V(v, e)
  250. case *map[string]uint64:
  251. fastpathTV.EncMapStringUint64V(*v, e)
  252. case map[string]int:
  253. fastpathTV.EncMapStringIntV(v, e)
  254. case *map[string]int:
  255. fastpathTV.EncMapStringIntV(*v, e)
  256. case map[string]int64:
  257. fastpathTV.EncMapStringInt64V(v, e)
  258. case *map[string]int64:
  259. fastpathTV.EncMapStringInt64V(*v, e)
  260. case map[string]float32:
  261. fastpathTV.EncMapStringFloat32V(v, e)
  262. case *map[string]float32:
  263. fastpathTV.EncMapStringFloat32V(*v, e)
  264. case map[string]float64:
  265. fastpathTV.EncMapStringFloat64V(v, e)
  266. case *map[string]float64:
  267. fastpathTV.EncMapStringFloat64V(*v, e)
  268. case map[string]bool:
  269. fastpathTV.EncMapStringBoolV(v, e)
  270. case *map[string]bool:
  271. fastpathTV.EncMapStringBoolV(*v, e)
  272. case map[uint]interface{}:
  273. fastpathTV.EncMapUintIntfV(v, e)
  274. case *map[uint]interface{}:
  275. fastpathTV.EncMapUintIntfV(*v, e)
  276. case map[uint]string:
  277. fastpathTV.EncMapUintStringV(v, e)
  278. case *map[uint]string:
  279. fastpathTV.EncMapUintStringV(*v, e)
  280. case map[uint][]byte:
  281. fastpathTV.EncMapUintBytesV(v, e)
  282. case *map[uint][]byte:
  283. fastpathTV.EncMapUintBytesV(*v, e)
  284. case map[uint]uint:
  285. fastpathTV.EncMapUintUintV(v, e)
  286. case *map[uint]uint:
  287. fastpathTV.EncMapUintUintV(*v, e)
  288. case map[uint]uint8:
  289. fastpathTV.EncMapUintUint8V(v, e)
  290. case *map[uint]uint8:
  291. fastpathTV.EncMapUintUint8V(*v, e)
  292. case map[uint]uint64:
  293. fastpathTV.EncMapUintUint64V(v, e)
  294. case *map[uint]uint64:
  295. fastpathTV.EncMapUintUint64V(*v, e)
  296. case map[uint]int:
  297. fastpathTV.EncMapUintIntV(v, e)
  298. case *map[uint]int:
  299. fastpathTV.EncMapUintIntV(*v, e)
  300. case map[uint]int64:
  301. fastpathTV.EncMapUintInt64V(v, e)
  302. case *map[uint]int64:
  303. fastpathTV.EncMapUintInt64V(*v, e)
  304. case map[uint]float32:
  305. fastpathTV.EncMapUintFloat32V(v, e)
  306. case *map[uint]float32:
  307. fastpathTV.EncMapUintFloat32V(*v, e)
  308. case map[uint]float64:
  309. fastpathTV.EncMapUintFloat64V(v, e)
  310. case *map[uint]float64:
  311. fastpathTV.EncMapUintFloat64V(*v, e)
  312. case map[uint]bool:
  313. fastpathTV.EncMapUintBoolV(v, e)
  314. case *map[uint]bool:
  315. fastpathTV.EncMapUintBoolV(*v, e)
  316. case map[uint8]interface{}:
  317. fastpathTV.EncMapUint8IntfV(v, e)
  318. case *map[uint8]interface{}:
  319. fastpathTV.EncMapUint8IntfV(*v, e)
  320. case map[uint8]string:
  321. fastpathTV.EncMapUint8StringV(v, e)
  322. case *map[uint8]string:
  323. fastpathTV.EncMapUint8StringV(*v, e)
  324. case map[uint8][]byte:
  325. fastpathTV.EncMapUint8BytesV(v, e)
  326. case *map[uint8][]byte:
  327. fastpathTV.EncMapUint8BytesV(*v, e)
  328. case map[uint8]uint:
  329. fastpathTV.EncMapUint8UintV(v, e)
  330. case *map[uint8]uint:
  331. fastpathTV.EncMapUint8UintV(*v, e)
  332. case map[uint8]uint8:
  333. fastpathTV.EncMapUint8Uint8V(v, e)
  334. case *map[uint8]uint8:
  335. fastpathTV.EncMapUint8Uint8V(*v, e)
  336. case map[uint8]uint64:
  337. fastpathTV.EncMapUint8Uint64V(v, e)
  338. case *map[uint8]uint64:
  339. fastpathTV.EncMapUint8Uint64V(*v, e)
  340. case map[uint8]int:
  341. fastpathTV.EncMapUint8IntV(v, e)
  342. case *map[uint8]int:
  343. fastpathTV.EncMapUint8IntV(*v, e)
  344. case map[uint8]int64:
  345. fastpathTV.EncMapUint8Int64V(v, e)
  346. case *map[uint8]int64:
  347. fastpathTV.EncMapUint8Int64V(*v, e)
  348. case map[uint8]float32:
  349. fastpathTV.EncMapUint8Float32V(v, e)
  350. case *map[uint8]float32:
  351. fastpathTV.EncMapUint8Float32V(*v, e)
  352. case map[uint8]float64:
  353. fastpathTV.EncMapUint8Float64V(v, e)
  354. case *map[uint8]float64:
  355. fastpathTV.EncMapUint8Float64V(*v, e)
  356. case map[uint8]bool:
  357. fastpathTV.EncMapUint8BoolV(v, e)
  358. case *map[uint8]bool:
  359. fastpathTV.EncMapUint8BoolV(*v, e)
  360. case map[uint64]interface{}:
  361. fastpathTV.EncMapUint64IntfV(v, e)
  362. case *map[uint64]interface{}:
  363. fastpathTV.EncMapUint64IntfV(*v, e)
  364. case map[uint64]string:
  365. fastpathTV.EncMapUint64StringV(v, e)
  366. case *map[uint64]string:
  367. fastpathTV.EncMapUint64StringV(*v, e)
  368. case map[uint64][]byte:
  369. fastpathTV.EncMapUint64BytesV(v, e)
  370. case *map[uint64][]byte:
  371. fastpathTV.EncMapUint64BytesV(*v, e)
  372. case map[uint64]uint:
  373. fastpathTV.EncMapUint64UintV(v, e)
  374. case *map[uint64]uint:
  375. fastpathTV.EncMapUint64UintV(*v, e)
  376. case map[uint64]uint8:
  377. fastpathTV.EncMapUint64Uint8V(v, e)
  378. case *map[uint64]uint8:
  379. fastpathTV.EncMapUint64Uint8V(*v, e)
  380. case map[uint64]uint64:
  381. fastpathTV.EncMapUint64Uint64V(v, e)
  382. case *map[uint64]uint64:
  383. fastpathTV.EncMapUint64Uint64V(*v, e)
  384. case map[uint64]int:
  385. fastpathTV.EncMapUint64IntV(v, e)
  386. case *map[uint64]int:
  387. fastpathTV.EncMapUint64IntV(*v, e)
  388. case map[uint64]int64:
  389. fastpathTV.EncMapUint64Int64V(v, e)
  390. case *map[uint64]int64:
  391. fastpathTV.EncMapUint64Int64V(*v, e)
  392. case map[uint64]float32:
  393. fastpathTV.EncMapUint64Float32V(v, e)
  394. case *map[uint64]float32:
  395. fastpathTV.EncMapUint64Float32V(*v, e)
  396. case map[uint64]float64:
  397. fastpathTV.EncMapUint64Float64V(v, e)
  398. case *map[uint64]float64:
  399. fastpathTV.EncMapUint64Float64V(*v, e)
  400. case map[uint64]bool:
  401. fastpathTV.EncMapUint64BoolV(v, e)
  402. case *map[uint64]bool:
  403. fastpathTV.EncMapUint64BoolV(*v, e)
  404. case map[int]interface{}:
  405. fastpathTV.EncMapIntIntfV(v, e)
  406. case *map[int]interface{}:
  407. fastpathTV.EncMapIntIntfV(*v, e)
  408. case map[int]string:
  409. fastpathTV.EncMapIntStringV(v, e)
  410. case *map[int]string:
  411. fastpathTV.EncMapIntStringV(*v, e)
  412. case map[int][]byte:
  413. fastpathTV.EncMapIntBytesV(v, e)
  414. case *map[int][]byte:
  415. fastpathTV.EncMapIntBytesV(*v, e)
  416. case map[int]uint:
  417. fastpathTV.EncMapIntUintV(v, e)
  418. case *map[int]uint:
  419. fastpathTV.EncMapIntUintV(*v, e)
  420. case map[int]uint8:
  421. fastpathTV.EncMapIntUint8V(v, e)
  422. case *map[int]uint8:
  423. fastpathTV.EncMapIntUint8V(*v, e)
  424. case map[int]uint64:
  425. fastpathTV.EncMapIntUint64V(v, e)
  426. case *map[int]uint64:
  427. fastpathTV.EncMapIntUint64V(*v, e)
  428. case map[int]int:
  429. fastpathTV.EncMapIntIntV(v, e)
  430. case *map[int]int:
  431. fastpathTV.EncMapIntIntV(*v, e)
  432. case map[int]int64:
  433. fastpathTV.EncMapIntInt64V(v, e)
  434. case *map[int]int64:
  435. fastpathTV.EncMapIntInt64V(*v, e)
  436. case map[int]float32:
  437. fastpathTV.EncMapIntFloat32V(v, e)
  438. case *map[int]float32:
  439. fastpathTV.EncMapIntFloat32V(*v, e)
  440. case map[int]float64:
  441. fastpathTV.EncMapIntFloat64V(v, e)
  442. case *map[int]float64:
  443. fastpathTV.EncMapIntFloat64V(*v, e)
  444. case map[int]bool:
  445. fastpathTV.EncMapIntBoolV(v, e)
  446. case *map[int]bool:
  447. fastpathTV.EncMapIntBoolV(*v, e)
  448. case map[int64]interface{}:
  449. fastpathTV.EncMapInt64IntfV(v, e)
  450. case *map[int64]interface{}:
  451. fastpathTV.EncMapInt64IntfV(*v, e)
  452. case map[int64]string:
  453. fastpathTV.EncMapInt64StringV(v, e)
  454. case *map[int64]string:
  455. fastpathTV.EncMapInt64StringV(*v, e)
  456. case map[int64][]byte:
  457. fastpathTV.EncMapInt64BytesV(v, e)
  458. case *map[int64][]byte:
  459. fastpathTV.EncMapInt64BytesV(*v, e)
  460. case map[int64]uint:
  461. fastpathTV.EncMapInt64UintV(v, e)
  462. case *map[int64]uint:
  463. fastpathTV.EncMapInt64UintV(*v, e)
  464. case map[int64]uint8:
  465. fastpathTV.EncMapInt64Uint8V(v, e)
  466. case *map[int64]uint8:
  467. fastpathTV.EncMapInt64Uint8V(*v, e)
  468. case map[int64]uint64:
  469. fastpathTV.EncMapInt64Uint64V(v, e)
  470. case *map[int64]uint64:
  471. fastpathTV.EncMapInt64Uint64V(*v, e)
  472. case map[int64]int:
  473. fastpathTV.EncMapInt64IntV(v, e)
  474. case *map[int64]int:
  475. fastpathTV.EncMapInt64IntV(*v, e)
  476. case map[int64]int64:
  477. fastpathTV.EncMapInt64Int64V(v, e)
  478. case *map[int64]int64:
  479. fastpathTV.EncMapInt64Int64V(*v, e)
  480. case map[int64]float32:
  481. fastpathTV.EncMapInt64Float32V(v, e)
  482. case *map[int64]float32:
  483. fastpathTV.EncMapInt64Float32V(*v, e)
  484. case map[int64]float64:
  485. fastpathTV.EncMapInt64Float64V(v, e)
  486. case *map[int64]float64:
  487. fastpathTV.EncMapInt64Float64V(*v, e)
  488. case map[int64]bool:
  489. fastpathTV.EncMapInt64BoolV(v, e)
  490. case *map[int64]bool:
  491. fastpathTV.EncMapInt64BoolV(*v, e)
  492. default:
  493. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  494. return false
  495. }
  496. return true
  497. }
  498. // -- -- fast path functions
  499. func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  500. if f.ti.mbs {
  501. fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e)
  502. } else {
  503. fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e)
  504. }
  505. }
  506. func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) {
  507. if v == nil {
  508. e.e.EncodeNil()
  509. return
  510. }
  511. e.arrayStart(len(v))
  512. for j := range v {
  513. e.arrayElem()
  514. e.encode(v[j])
  515. }
  516. e.arrayEnd()
  517. }
  518. func (fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) {
  519. if v == nil {
  520. e.e.EncodeNil()
  521. } else if len(v)%2 == 1 {
  522. e.errorf(fastpathMapBySliceErrMsg, len(v))
  523. } else {
  524. e.mapStart(len(v) / 2)
  525. for j := range v {
  526. if j%2 == 0 {
  527. e.mapElemKey()
  528. } else {
  529. e.mapElemValue()
  530. }
  531. e.encode(v[j])
  532. }
  533. e.mapEnd()
  534. }
  535. }
  536. func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) {
  537. if f.ti.mbs {
  538. fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e)
  539. } else {
  540. fastpathTV.EncSliceStringV(rv2i(rv).([]string), e)
  541. }
  542. }
  543. func (fastpathT) EncSliceStringV(v []string, e *Encoder) {
  544. if v == nil {
  545. e.e.EncodeNil()
  546. return
  547. }
  548. e.arrayStart(len(v))
  549. for j := range v {
  550. e.arrayElem()
  551. if e.h.StringToRaw {
  552. e.e.EncodeStringBytesRaw(bytesView(v[j]))
  553. } else {
  554. e.e.EncodeStringEnc(cUTF8, v[j])
  555. }
  556. }
  557. e.arrayEnd()
  558. }
  559. func (fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) {
  560. if v == nil {
  561. e.e.EncodeNil()
  562. } else if len(v)%2 == 1 {
  563. e.errorf(fastpathMapBySliceErrMsg, len(v))
  564. } else {
  565. e.mapStart(len(v) / 2)
  566. for j := range v {
  567. if j%2 == 0 {
  568. e.mapElemKey()
  569. } else {
  570. e.mapElemValue()
  571. }
  572. if e.h.StringToRaw {
  573. e.e.EncodeStringBytesRaw(bytesView(v[j]))
  574. } else {
  575. e.e.EncodeStringEnc(cUTF8, v[j])
  576. }
  577. }
  578. e.mapEnd()
  579. }
  580. }
  581. func (e *Encoder) fastpathEncSliceBytesR(f *codecFnInfo, rv reflect.Value) {
  582. if f.ti.mbs {
  583. fastpathTV.EncAsMapSliceBytesV(rv2i(rv).([][]byte), e)
  584. } else {
  585. fastpathTV.EncSliceBytesV(rv2i(rv).([][]byte), e)
  586. }
  587. }
  588. func (fastpathT) EncSliceBytesV(v [][]byte, e *Encoder) {
  589. if v == nil {
  590. e.e.EncodeNil()
  591. return
  592. }
  593. e.arrayStart(len(v))
  594. for j := range v {
  595. e.arrayElem()
  596. e.e.EncodeStringBytesRaw(v[j])
  597. }
  598. e.arrayEnd()
  599. }
  600. func (fastpathT) EncAsMapSliceBytesV(v [][]byte, e *Encoder) {
  601. if v == nil {
  602. e.e.EncodeNil()
  603. } else if len(v)%2 == 1 {
  604. e.errorf(fastpathMapBySliceErrMsg, len(v))
  605. } else {
  606. e.mapStart(len(v) / 2)
  607. for j := range v {
  608. if j%2 == 0 {
  609. e.mapElemKey()
  610. } else {
  611. e.mapElemValue()
  612. }
  613. e.e.EncodeStringBytesRaw(v[j])
  614. }
  615. e.mapEnd()
  616. }
  617. }
  618. func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  619. if f.ti.mbs {
  620. fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e)
  621. } else {
  622. fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e)
  623. }
  624. }
  625. func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) {
  626. if v == nil {
  627. e.e.EncodeNil()
  628. return
  629. }
  630. e.arrayStart(len(v))
  631. for j := range v {
  632. e.arrayElem()
  633. e.e.EncodeFloat32(v[j])
  634. }
  635. e.arrayEnd()
  636. }
  637. func (fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) {
  638. if v == nil {
  639. e.e.EncodeNil()
  640. } else if len(v)%2 == 1 {
  641. e.errorf(fastpathMapBySliceErrMsg, len(v))
  642. } else {
  643. e.mapStart(len(v) / 2)
  644. for j := range v {
  645. if j%2 == 0 {
  646. e.mapElemKey()
  647. } else {
  648. e.mapElemValue()
  649. }
  650. e.e.EncodeFloat32(v[j])
  651. }
  652. e.mapEnd()
  653. }
  654. }
  655. func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  656. if f.ti.mbs {
  657. fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e)
  658. } else {
  659. fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e)
  660. }
  661. }
  662. func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) {
  663. if v == nil {
  664. e.e.EncodeNil()
  665. return
  666. }
  667. e.arrayStart(len(v))
  668. for j := range v {
  669. e.arrayElem()
  670. e.e.EncodeFloat64(v[j])
  671. }
  672. e.arrayEnd()
  673. }
  674. func (fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) {
  675. if v == nil {
  676. e.e.EncodeNil()
  677. } else if len(v)%2 == 1 {
  678. e.errorf(fastpathMapBySliceErrMsg, len(v))
  679. } else {
  680. e.mapStart(len(v) / 2)
  681. for j := range v {
  682. if j%2 == 0 {
  683. e.mapElemKey()
  684. } else {
  685. e.mapElemValue()
  686. }
  687. e.e.EncodeFloat64(v[j])
  688. }
  689. e.mapEnd()
  690. }
  691. }
  692. func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) {
  693. if f.ti.mbs {
  694. fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e)
  695. } else {
  696. fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e)
  697. }
  698. }
  699. func (fastpathT) EncSliceUintV(v []uint, e *Encoder) {
  700. if v == nil {
  701. e.e.EncodeNil()
  702. return
  703. }
  704. e.arrayStart(len(v))
  705. for j := range v {
  706. e.arrayElem()
  707. e.e.EncodeUint(uint64(v[j]))
  708. }
  709. e.arrayEnd()
  710. }
  711. func (fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) {
  712. if v == nil {
  713. e.e.EncodeNil()
  714. } else if len(v)%2 == 1 {
  715. e.errorf(fastpathMapBySliceErrMsg, len(v))
  716. } else {
  717. e.mapStart(len(v) / 2)
  718. for j := range v {
  719. if j%2 == 0 {
  720. e.mapElemKey()
  721. } else {
  722. e.mapElemValue()
  723. }
  724. e.e.EncodeUint(uint64(v[j]))
  725. }
  726. e.mapEnd()
  727. }
  728. }
  729. func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  730. if f.ti.mbs {
  731. fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e)
  732. } else {
  733. fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e)
  734. }
  735. }
  736. func (fastpathT) EncSliceUint16V(v []uint16, e *Encoder) {
  737. if v == nil {
  738. e.e.EncodeNil()
  739. return
  740. }
  741. e.arrayStart(len(v))
  742. for j := range v {
  743. e.arrayElem()
  744. e.e.EncodeUint(uint64(v[j]))
  745. }
  746. e.arrayEnd()
  747. }
  748. func (fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) {
  749. if v == nil {
  750. e.e.EncodeNil()
  751. } else if len(v)%2 == 1 {
  752. e.errorf(fastpathMapBySliceErrMsg, len(v))
  753. } else {
  754. e.mapStart(len(v) / 2)
  755. for j := range v {
  756. if j%2 == 0 {
  757. e.mapElemKey()
  758. } else {
  759. e.mapElemValue()
  760. }
  761. e.e.EncodeUint(uint64(v[j]))
  762. }
  763. e.mapEnd()
  764. }
  765. }
  766. func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  767. if f.ti.mbs {
  768. fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e)
  769. } else {
  770. fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e)
  771. }
  772. }
  773. func (fastpathT) EncSliceUint32V(v []uint32, e *Encoder) {
  774. if v == nil {
  775. e.e.EncodeNil()
  776. return
  777. }
  778. e.arrayStart(len(v))
  779. for j := range v {
  780. e.arrayElem()
  781. e.e.EncodeUint(uint64(v[j]))
  782. }
  783. e.arrayEnd()
  784. }
  785. func (fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) {
  786. if v == nil {
  787. e.e.EncodeNil()
  788. } else if len(v)%2 == 1 {
  789. e.errorf(fastpathMapBySliceErrMsg, len(v))
  790. } else {
  791. e.mapStart(len(v) / 2)
  792. for j := range v {
  793. if j%2 == 0 {
  794. e.mapElemKey()
  795. } else {
  796. e.mapElemValue()
  797. }
  798. e.e.EncodeUint(uint64(v[j]))
  799. }
  800. e.mapEnd()
  801. }
  802. }
  803. func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  804. if f.ti.mbs {
  805. fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e)
  806. } else {
  807. fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e)
  808. }
  809. }
  810. func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) {
  811. if v == nil {
  812. e.e.EncodeNil()
  813. return
  814. }
  815. e.arrayStart(len(v))
  816. for j := range v {
  817. e.arrayElem()
  818. e.e.EncodeUint(v[j])
  819. }
  820. e.arrayEnd()
  821. }
  822. func (fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) {
  823. if v == nil {
  824. e.e.EncodeNil()
  825. } else if len(v)%2 == 1 {
  826. e.errorf(fastpathMapBySliceErrMsg, len(v))
  827. } else {
  828. e.mapStart(len(v) / 2)
  829. for j := range v {
  830. if j%2 == 0 {
  831. e.mapElemKey()
  832. } else {
  833. e.mapElemValue()
  834. }
  835. e.e.EncodeUint(v[j])
  836. }
  837. e.mapEnd()
  838. }
  839. }
  840. func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) {
  841. if f.ti.mbs {
  842. fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e)
  843. } else {
  844. fastpathTV.EncSliceIntV(rv2i(rv).([]int), e)
  845. }
  846. }
  847. func (fastpathT) EncSliceIntV(v []int, e *Encoder) {
  848. if v == nil {
  849. e.e.EncodeNil()
  850. return
  851. }
  852. e.arrayStart(len(v))
  853. for j := range v {
  854. e.arrayElem()
  855. e.e.EncodeInt(int64(v[j]))
  856. }
  857. e.arrayEnd()
  858. }
  859. func (fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) {
  860. if v == nil {
  861. e.e.EncodeNil()
  862. } else if len(v)%2 == 1 {
  863. e.errorf(fastpathMapBySliceErrMsg, len(v))
  864. } else {
  865. e.mapStart(len(v) / 2)
  866. for j := range v {
  867. if j%2 == 0 {
  868. e.mapElemKey()
  869. } else {
  870. e.mapElemValue()
  871. }
  872. e.e.EncodeInt(int64(v[j]))
  873. }
  874. e.mapEnd()
  875. }
  876. }
  877. func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  878. if f.ti.mbs {
  879. fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e)
  880. } else {
  881. fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e)
  882. }
  883. }
  884. func (fastpathT) EncSliceInt8V(v []int8, e *Encoder) {
  885. if v == nil {
  886. e.e.EncodeNil()
  887. return
  888. }
  889. e.arrayStart(len(v))
  890. for j := range v {
  891. e.arrayElem()
  892. e.e.EncodeInt(int64(v[j]))
  893. }
  894. e.arrayEnd()
  895. }
  896. func (fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) {
  897. if v == nil {
  898. e.e.EncodeNil()
  899. } else if len(v)%2 == 1 {
  900. e.errorf(fastpathMapBySliceErrMsg, len(v))
  901. } else {
  902. e.mapStart(len(v) / 2)
  903. for j := range v {
  904. if j%2 == 0 {
  905. e.mapElemKey()
  906. } else {
  907. e.mapElemValue()
  908. }
  909. e.e.EncodeInt(int64(v[j]))
  910. }
  911. e.mapEnd()
  912. }
  913. }
  914. func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  915. if f.ti.mbs {
  916. fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e)
  917. } else {
  918. fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e)
  919. }
  920. }
  921. func (fastpathT) EncSliceInt16V(v []int16, e *Encoder) {
  922. if v == nil {
  923. e.e.EncodeNil()
  924. return
  925. }
  926. e.arrayStart(len(v))
  927. for j := range v {
  928. e.arrayElem()
  929. e.e.EncodeInt(int64(v[j]))
  930. }
  931. e.arrayEnd()
  932. }
  933. func (fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) {
  934. if v == nil {
  935. e.e.EncodeNil()
  936. } else if len(v)%2 == 1 {
  937. e.errorf(fastpathMapBySliceErrMsg, len(v))
  938. } else {
  939. e.mapStart(len(v) / 2)
  940. for j := range v {
  941. if j%2 == 0 {
  942. e.mapElemKey()
  943. } else {
  944. e.mapElemValue()
  945. }
  946. e.e.EncodeInt(int64(v[j]))
  947. }
  948. e.mapEnd()
  949. }
  950. }
  951. func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  952. if f.ti.mbs {
  953. fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e)
  954. } else {
  955. fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e)
  956. }
  957. }
  958. func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) {
  959. if v == nil {
  960. e.e.EncodeNil()
  961. return
  962. }
  963. e.arrayStart(len(v))
  964. for j := range v {
  965. e.arrayElem()
  966. e.e.EncodeInt(int64(v[j]))
  967. }
  968. e.arrayEnd()
  969. }
  970. func (fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) {
  971. if v == nil {
  972. e.e.EncodeNil()
  973. } else if len(v)%2 == 1 {
  974. e.errorf(fastpathMapBySliceErrMsg, len(v))
  975. } else {
  976. e.mapStart(len(v) / 2)
  977. for j := range v {
  978. if j%2 == 0 {
  979. e.mapElemKey()
  980. } else {
  981. e.mapElemValue()
  982. }
  983. e.e.EncodeInt(int64(v[j]))
  984. }
  985. e.mapEnd()
  986. }
  987. }
  988. func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  989. if f.ti.mbs {
  990. fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e)
  991. } else {
  992. fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e)
  993. }
  994. }
  995. func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) {
  996. if v == nil {
  997. e.e.EncodeNil()
  998. return
  999. }
  1000. e.arrayStart(len(v))
  1001. for j := range v {
  1002. e.arrayElem()
  1003. e.e.EncodeInt(v[j])
  1004. }
  1005. e.arrayEnd()
  1006. }
  1007. func (fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) {
  1008. if v == nil {
  1009. e.e.EncodeNil()
  1010. } else if len(v)%2 == 1 {
  1011. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1012. } else {
  1013. e.mapStart(len(v) / 2)
  1014. for j := range v {
  1015. if j%2 == 0 {
  1016. e.mapElemKey()
  1017. } else {
  1018. e.mapElemValue()
  1019. }
  1020. e.e.EncodeInt(v[j])
  1021. }
  1022. e.mapEnd()
  1023. }
  1024. }
  1025. func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  1026. if f.ti.mbs {
  1027. fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e)
  1028. } else {
  1029. fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e)
  1030. }
  1031. }
  1032. func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) {
  1033. if v == nil {
  1034. e.e.EncodeNil()
  1035. return
  1036. }
  1037. e.arrayStart(len(v))
  1038. for j := range v {
  1039. e.arrayElem()
  1040. e.e.EncodeBool(v[j])
  1041. }
  1042. e.arrayEnd()
  1043. }
  1044. func (fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) {
  1045. if v == nil {
  1046. e.e.EncodeNil()
  1047. } else if len(v)%2 == 1 {
  1048. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1049. } else {
  1050. e.mapStart(len(v) / 2)
  1051. for j := range v {
  1052. if j%2 == 0 {
  1053. e.mapElemKey()
  1054. } else {
  1055. e.mapElemValue()
  1056. }
  1057. e.e.EncodeBool(v[j])
  1058. }
  1059. e.mapEnd()
  1060. }
  1061. }
  1062. func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  1063. fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e)
  1064. }
  1065. func (fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) {
  1066. if v == nil {
  1067. e.e.EncodeNil()
  1068. return
  1069. }
  1070. e.mapStart(len(v))
  1071. if e.h.Canonical {
  1072. v2 := make([]string, len(v))
  1073. var i uint
  1074. for k := range v {
  1075. v2[i] = k
  1076. i++
  1077. }
  1078. sort.Sort(stringSlice(v2))
  1079. for _, k2 := range v2 {
  1080. e.mapElemKey()
  1081. if e.h.StringToRaw {
  1082. e.e.EncodeStringBytesRaw(bytesView(k2))
  1083. } else {
  1084. e.e.EncodeStringEnc(cUTF8, k2)
  1085. }
  1086. e.mapElemValue()
  1087. e.encode(v[k2])
  1088. }
  1089. } else {
  1090. for k2, v2 := range v {
  1091. e.mapElemKey()
  1092. if e.h.StringToRaw {
  1093. e.e.EncodeStringBytesRaw(bytesView(k2))
  1094. } else {
  1095. e.e.EncodeStringEnc(cUTF8, k2)
  1096. }
  1097. e.mapElemValue()
  1098. e.encode(v2)
  1099. }
  1100. }
  1101. e.mapEnd()
  1102. }
  1103. func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  1104. fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e)
  1105. }
  1106. func (fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) {
  1107. if v == nil {
  1108. e.e.EncodeNil()
  1109. return
  1110. }
  1111. e.mapStart(len(v))
  1112. if e.h.Canonical {
  1113. v2 := make([]string, len(v))
  1114. var i uint
  1115. for k := range v {
  1116. v2[i] = k
  1117. i++
  1118. }
  1119. sort.Sort(stringSlice(v2))
  1120. for _, k2 := range v2 {
  1121. e.mapElemKey()
  1122. if e.h.StringToRaw {
  1123. e.e.EncodeStringBytesRaw(bytesView(k2))
  1124. } else {
  1125. e.e.EncodeStringEnc(cUTF8, k2)
  1126. }
  1127. e.mapElemValue()
  1128. if e.h.StringToRaw {
  1129. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  1130. } else {
  1131. e.e.EncodeStringEnc(cUTF8, v[k2])
  1132. }
  1133. }
  1134. } else {
  1135. for k2, v2 := range v {
  1136. e.mapElemKey()
  1137. if e.h.StringToRaw {
  1138. e.e.EncodeStringBytesRaw(bytesView(k2))
  1139. } else {
  1140. e.e.EncodeStringEnc(cUTF8, k2)
  1141. }
  1142. e.mapElemValue()
  1143. if e.h.StringToRaw {
  1144. e.e.EncodeStringBytesRaw(bytesView(v2))
  1145. } else {
  1146. e.e.EncodeStringEnc(cUTF8, v2)
  1147. }
  1148. }
  1149. }
  1150. e.mapEnd()
  1151. }
  1152. func (e *Encoder) fastpathEncMapStringBytesR(f *codecFnInfo, rv reflect.Value) {
  1153. fastpathTV.EncMapStringBytesV(rv2i(rv).(map[string][]byte), e)
  1154. }
  1155. func (fastpathT) EncMapStringBytesV(v map[string][]byte, e *Encoder) {
  1156. if v == nil {
  1157. e.e.EncodeNil()
  1158. return
  1159. }
  1160. e.mapStart(len(v))
  1161. if e.h.Canonical {
  1162. v2 := make([]string, len(v))
  1163. var i uint
  1164. for k := range v {
  1165. v2[i] = k
  1166. i++
  1167. }
  1168. sort.Sort(stringSlice(v2))
  1169. for _, k2 := range v2 {
  1170. e.mapElemKey()
  1171. if e.h.StringToRaw {
  1172. e.e.EncodeStringBytesRaw(bytesView(k2))
  1173. } else {
  1174. e.e.EncodeStringEnc(cUTF8, k2)
  1175. }
  1176. e.mapElemValue()
  1177. e.e.EncodeStringBytesRaw(v[k2])
  1178. }
  1179. } else {
  1180. for k2, v2 := range v {
  1181. e.mapElemKey()
  1182. if e.h.StringToRaw {
  1183. e.e.EncodeStringBytesRaw(bytesView(k2))
  1184. } else {
  1185. e.e.EncodeStringEnc(cUTF8, k2)
  1186. }
  1187. e.mapElemValue()
  1188. e.e.EncodeStringBytesRaw(v2)
  1189. }
  1190. }
  1191. e.mapEnd()
  1192. }
  1193. func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  1194. fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e)
  1195. }
  1196. func (fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) {
  1197. if v == nil {
  1198. e.e.EncodeNil()
  1199. return
  1200. }
  1201. e.mapStart(len(v))
  1202. if e.h.Canonical {
  1203. v2 := make([]string, len(v))
  1204. var i uint
  1205. for k := range v {
  1206. v2[i] = k
  1207. i++
  1208. }
  1209. sort.Sort(stringSlice(v2))
  1210. for _, k2 := range v2 {
  1211. e.mapElemKey()
  1212. if e.h.StringToRaw {
  1213. e.e.EncodeStringBytesRaw(bytesView(k2))
  1214. } else {
  1215. e.e.EncodeStringEnc(cUTF8, k2)
  1216. }
  1217. e.mapElemValue()
  1218. e.e.EncodeUint(uint64(v[k2]))
  1219. }
  1220. } else {
  1221. for k2, v2 := range v {
  1222. e.mapElemKey()
  1223. if e.h.StringToRaw {
  1224. e.e.EncodeStringBytesRaw(bytesView(k2))
  1225. } else {
  1226. e.e.EncodeStringEnc(cUTF8, k2)
  1227. }
  1228. e.mapElemValue()
  1229. e.e.EncodeUint(uint64(v2))
  1230. }
  1231. }
  1232. e.mapEnd()
  1233. }
  1234. func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  1235. fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e)
  1236. }
  1237. func (fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) {
  1238. if v == nil {
  1239. e.e.EncodeNil()
  1240. return
  1241. }
  1242. e.mapStart(len(v))
  1243. if e.h.Canonical {
  1244. v2 := make([]string, len(v))
  1245. var i uint
  1246. for k := range v {
  1247. v2[i] = k
  1248. i++
  1249. }
  1250. sort.Sort(stringSlice(v2))
  1251. for _, k2 := range v2 {
  1252. e.mapElemKey()
  1253. if e.h.StringToRaw {
  1254. e.e.EncodeStringBytesRaw(bytesView(k2))
  1255. } else {
  1256. e.e.EncodeStringEnc(cUTF8, k2)
  1257. }
  1258. e.mapElemValue()
  1259. e.e.EncodeUint(uint64(v[k2]))
  1260. }
  1261. } else {
  1262. for k2, v2 := range v {
  1263. e.mapElemKey()
  1264. if e.h.StringToRaw {
  1265. e.e.EncodeStringBytesRaw(bytesView(k2))
  1266. } else {
  1267. e.e.EncodeStringEnc(cUTF8, k2)
  1268. }
  1269. e.mapElemValue()
  1270. e.e.EncodeUint(uint64(v2))
  1271. }
  1272. }
  1273. e.mapEnd()
  1274. }
  1275. func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  1276. fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e)
  1277. }
  1278. func (fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) {
  1279. if v == nil {
  1280. e.e.EncodeNil()
  1281. return
  1282. }
  1283. e.mapStart(len(v))
  1284. if e.h.Canonical {
  1285. v2 := make([]string, len(v))
  1286. var i uint
  1287. for k := range v {
  1288. v2[i] = k
  1289. i++
  1290. }
  1291. sort.Sort(stringSlice(v2))
  1292. for _, k2 := range v2 {
  1293. e.mapElemKey()
  1294. if e.h.StringToRaw {
  1295. e.e.EncodeStringBytesRaw(bytesView(k2))
  1296. } else {
  1297. e.e.EncodeStringEnc(cUTF8, k2)
  1298. }
  1299. e.mapElemValue()
  1300. e.e.EncodeUint(v[k2])
  1301. }
  1302. } else {
  1303. for k2, v2 := range v {
  1304. e.mapElemKey()
  1305. if e.h.StringToRaw {
  1306. e.e.EncodeStringBytesRaw(bytesView(k2))
  1307. } else {
  1308. e.e.EncodeStringEnc(cUTF8, k2)
  1309. }
  1310. e.mapElemValue()
  1311. e.e.EncodeUint(v2)
  1312. }
  1313. }
  1314. e.mapEnd()
  1315. }
  1316. func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  1317. fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e)
  1318. }
  1319. func (fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) {
  1320. if v == nil {
  1321. e.e.EncodeNil()
  1322. return
  1323. }
  1324. e.mapStart(len(v))
  1325. if e.h.Canonical {
  1326. v2 := make([]string, len(v))
  1327. var i uint
  1328. for k := range v {
  1329. v2[i] = k
  1330. i++
  1331. }
  1332. sort.Sort(stringSlice(v2))
  1333. for _, k2 := range v2 {
  1334. e.mapElemKey()
  1335. if e.h.StringToRaw {
  1336. e.e.EncodeStringBytesRaw(bytesView(k2))
  1337. } else {
  1338. e.e.EncodeStringEnc(cUTF8, k2)
  1339. }
  1340. e.mapElemValue()
  1341. e.e.EncodeInt(int64(v[k2]))
  1342. }
  1343. } else {
  1344. for k2, v2 := range v {
  1345. e.mapElemKey()
  1346. if e.h.StringToRaw {
  1347. e.e.EncodeStringBytesRaw(bytesView(k2))
  1348. } else {
  1349. e.e.EncodeStringEnc(cUTF8, k2)
  1350. }
  1351. e.mapElemValue()
  1352. e.e.EncodeInt(int64(v2))
  1353. }
  1354. }
  1355. e.mapEnd()
  1356. }
  1357. func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  1358. fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e)
  1359. }
  1360. func (fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) {
  1361. if v == nil {
  1362. e.e.EncodeNil()
  1363. return
  1364. }
  1365. e.mapStart(len(v))
  1366. if e.h.Canonical {
  1367. v2 := make([]string, len(v))
  1368. var i uint
  1369. for k := range v {
  1370. v2[i] = k
  1371. i++
  1372. }
  1373. sort.Sort(stringSlice(v2))
  1374. for _, k2 := range v2 {
  1375. e.mapElemKey()
  1376. if e.h.StringToRaw {
  1377. e.e.EncodeStringBytesRaw(bytesView(k2))
  1378. } else {
  1379. e.e.EncodeStringEnc(cUTF8, k2)
  1380. }
  1381. e.mapElemValue()
  1382. e.e.EncodeInt(v[k2])
  1383. }
  1384. } else {
  1385. for k2, v2 := range v {
  1386. e.mapElemKey()
  1387. if e.h.StringToRaw {
  1388. e.e.EncodeStringBytesRaw(bytesView(k2))
  1389. } else {
  1390. e.e.EncodeStringEnc(cUTF8, k2)
  1391. }
  1392. e.mapElemValue()
  1393. e.e.EncodeInt(v2)
  1394. }
  1395. }
  1396. e.mapEnd()
  1397. }
  1398. func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  1399. fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e)
  1400. }
  1401. func (fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) {
  1402. if v == nil {
  1403. e.e.EncodeNil()
  1404. return
  1405. }
  1406. e.mapStart(len(v))
  1407. if e.h.Canonical {
  1408. v2 := make([]string, len(v))
  1409. var i uint
  1410. for k := range v {
  1411. v2[i] = k
  1412. i++
  1413. }
  1414. sort.Sort(stringSlice(v2))
  1415. for _, k2 := range v2 {
  1416. e.mapElemKey()
  1417. if e.h.StringToRaw {
  1418. e.e.EncodeStringBytesRaw(bytesView(k2))
  1419. } else {
  1420. e.e.EncodeStringEnc(cUTF8, k2)
  1421. }
  1422. e.mapElemValue()
  1423. e.e.EncodeFloat32(v[k2])
  1424. }
  1425. } else {
  1426. for k2, v2 := range v {
  1427. e.mapElemKey()
  1428. if e.h.StringToRaw {
  1429. e.e.EncodeStringBytesRaw(bytesView(k2))
  1430. } else {
  1431. e.e.EncodeStringEnc(cUTF8, k2)
  1432. }
  1433. e.mapElemValue()
  1434. e.e.EncodeFloat32(v2)
  1435. }
  1436. }
  1437. e.mapEnd()
  1438. }
  1439. func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  1440. fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e)
  1441. }
  1442. func (fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) {
  1443. if v == nil {
  1444. e.e.EncodeNil()
  1445. return
  1446. }
  1447. e.mapStart(len(v))
  1448. if e.h.Canonical {
  1449. v2 := make([]string, len(v))
  1450. var i uint
  1451. for k := range v {
  1452. v2[i] = k
  1453. i++
  1454. }
  1455. sort.Sort(stringSlice(v2))
  1456. for _, k2 := range v2 {
  1457. e.mapElemKey()
  1458. if e.h.StringToRaw {
  1459. e.e.EncodeStringBytesRaw(bytesView(k2))
  1460. } else {
  1461. e.e.EncodeStringEnc(cUTF8, k2)
  1462. }
  1463. e.mapElemValue()
  1464. e.e.EncodeFloat64(v[k2])
  1465. }
  1466. } else {
  1467. for k2, v2 := range v {
  1468. e.mapElemKey()
  1469. if e.h.StringToRaw {
  1470. e.e.EncodeStringBytesRaw(bytesView(k2))
  1471. } else {
  1472. e.e.EncodeStringEnc(cUTF8, k2)
  1473. }
  1474. e.mapElemValue()
  1475. e.e.EncodeFloat64(v2)
  1476. }
  1477. }
  1478. e.mapEnd()
  1479. }
  1480. func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  1481. fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e)
  1482. }
  1483. func (fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) {
  1484. if v == nil {
  1485. e.e.EncodeNil()
  1486. return
  1487. }
  1488. e.mapStart(len(v))
  1489. if e.h.Canonical {
  1490. v2 := make([]string, len(v))
  1491. var i uint
  1492. for k := range v {
  1493. v2[i] = k
  1494. i++
  1495. }
  1496. sort.Sort(stringSlice(v2))
  1497. for _, k2 := range v2 {
  1498. e.mapElemKey()
  1499. if e.h.StringToRaw {
  1500. e.e.EncodeStringBytesRaw(bytesView(k2))
  1501. } else {
  1502. e.e.EncodeStringEnc(cUTF8, k2)
  1503. }
  1504. e.mapElemValue()
  1505. e.e.EncodeBool(v[k2])
  1506. }
  1507. } else {
  1508. for k2, v2 := range v {
  1509. e.mapElemKey()
  1510. if e.h.StringToRaw {
  1511. e.e.EncodeStringBytesRaw(bytesView(k2))
  1512. } else {
  1513. e.e.EncodeStringEnc(cUTF8, k2)
  1514. }
  1515. e.mapElemValue()
  1516. e.e.EncodeBool(v2)
  1517. }
  1518. }
  1519. e.mapEnd()
  1520. }
  1521. func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  1522. fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e)
  1523. }
  1524. func (fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) {
  1525. if v == nil {
  1526. e.e.EncodeNil()
  1527. return
  1528. }
  1529. e.mapStart(len(v))
  1530. if e.h.Canonical {
  1531. v2 := make([]uint64, len(v))
  1532. var i uint
  1533. for k := range v {
  1534. v2[i] = uint64(k)
  1535. i++
  1536. }
  1537. sort.Sort(uint64Slice(v2))
  1538. for _, k2 := range v2 {
  1539. e.mapElemKey()
  1540. e.e.EncodeUint(uint64(uint(k2)))
  1541. e.mapElemValue()
  1542. e.encode(v[uint(k2)])
  1543. }
  1544. } else {
  1545. for k2, v2 := range v {
  1546. e.mapElemKey()
  1547. e.e.EncodeUint(uint64(k2))
  1548. e.mapElemValue()
  1549. e.encode(v2)
  1550. }
  1551. }
  1552. e.mapEnd()
  1553. }
  1554. func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  1555. fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e)
  1556. }
  1557. func (fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) {
  1558. if v == nil {
  1559. e.e.EncodeNil()
  1560. return
  1561. }
  1562. e.mapStart(len(v))
  1563. if e.h.Canonical {
  1564. v2 := make([]uint64, len(v))
  1565. var i uint
  1566. for k := range v {
  1567. v2[i] = uint64(k)
  1568. i++
  1569. }
  1570. sort.Sort(uint64Slice(v2))
  1571. for _, k2 := range v2 {
  1572. e.mapElemKey()
  1573. e.e.EncodeUint(uint64(uint(k2)))
  1574. e.mapElemValue()
  1575. if e.h.StringToRaw {
  1576. e.e.EncodeStringBytesRaw(bytesView(v[uint(k2)]))
  1577. } else {
  1578. e.e.EncodeStringEnc(cUTF8, v[uint(k2)])
  1579. }
  1580. }
  1581. } else {
  1582. for k2, v2 := range v {
  1583. e.mapElemKey()
  1584. e.e.EncodeUint(uint64(k2))
  1585. e.mapElemValue()
  1586. if e.h.StringToRaw {
  1587. e.e.EncodeStringBytesRaw(bytesView(v2))
  1588. } else {
  1589. e.e.EncodeStringEnc(cUTF8, v2)
  1590. }
  1591. }
  1592. }
  1593. e.mapEnd()
  1594. }
  1595. func (e *Encoder) fastpathEncMapUintBytesR(f *codecFnInfo, rv reflect.Value) {
  1596. fastpathTV.EncMapUintBytesV(rv2i(rv).(map[uint][]byte), e)
  1597. }
  1598. func (fastpathT) EncMapUintBytesV(v map[uint][]byte, e *Encoder) {
  1599. if v == nil {
  1600. e.e.EncodeNil()
  1601. return
  1602. }
  1603. e.mapStart(len(v))
  1604. if e.h.Canonical {
  1605. v2 := make([]uint64, len(v))
  1606. var i uint
  1607. for k := range v {
  1608. v2[i] = uint64(k)
  1609. i++
  1610. }
  1611. sort.Sort(uint64Slice(v2))
  1612. for _, k2 := range v2 {
  1613. e.mapElemKey()
  1614. e.e.EncodeUint(uint64(uint(k2)))
  1615. e.mapElemValue()
  1616. e.e.EncodeStringBytesRaw(v[uint(k2)])
  1617. }
  1618. } else {
  1619. for k2, v2 := range v {
  1620. e.mapElemKey()
  1621. e.e.EncodeUint(uint64(k2))
  1622. e.mapElemValue()
  1623. e.e.EncodeStringBytesRaw(v2)
  1624. }
  1625. }
  1626. e.mapEnd()
  1627. }
  1628. func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  1629. fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e)
  1630. }
  1631. func (fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) {
  1632. if v == nil {
  1633. e.e.EncodeNil()
  1634. return
  1635. }
  1636. e.mapStart(len(v))
  1637. if e.h.Canonical {
  1638. v2 := make([]uint64, len(v))
  1639. var i uint
  1640. for k := range v {
  1641. v2[i] = uint64(k)
  1642. i++
  1643. }
  1644. sort.Sort(uint64Slice(v2))
  1645. for _, k2 := range v2 {
  1646. e.mapElemKey()
  1647. e.e.EncodeUint(uint64(uint(k2)))
  1648. e.mapElemValue()
  1649. e.e.EncodeUint(uint64(v[uint(k2)]))
  1650. }
  1651. } else {
  1652. for k2, v2 := range v {
  1653. e.mapElemKey()
  1654. e.e.EncodeUint(uint64(k2))
  1655. e.mapElemValue()
  1656. e.e.EncodeUint(uint64(v2))
  1657. }
  1658. }
  1659. e.mapEnd()
  1660. }
  1661. func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  1662. fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e)
  1663. }
  1664. func (fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) {
  1665. if v == nil {
  1666. e.e.EncodeNil()
  1667. return
  1668. }
  1669. e.mapStart(len(v))
  1670. if e.h.Canonical {
  1671. v2 := make([]uint64, len(v))
  1672. var i uint
  1673. for k := range v {
  1674. v2[i] = uint64(k)
  1675. i++
  1676. }
  1677. sort.Sort(uint64Slice(v2))
  1678. for _, k2 := range v2 {
  1679. e.mapElemKey()
  1680. e.e.EncodeUint(uint64(uint(k2)))
  1681. e.mapElemValue()
  1682. e.e.EncodeUint(uint64(v[uint(k2)]))
  1683. }
  1684. } else {
  1685. for k2, v2 := range v {
  1686. e.mapElemKey()
  1687. e.e.EncodeUint(uint64(k2))
  1688. e.mapElemValue()
  1689. e.e.EncodeUint(uint64(v2))
  1690. }
  1691. }
  1692. e.mapEnd()
  1693. }
  1694. func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  1695. fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e)
  1696. }
  1697. func (fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) {
  1698. if v == nil {
  1699. e.e.EncodeNil()
  1700. return
  1701. }
  1702. e.mapStart(len(v))
  1703. if e.h.Canonical {
  1704. v2 := make([]uint64, len(v))
  1705. var i uint
  1706. for k := range v {
  1707. v2[i] = uint64(k)
  1708. i++
  1709. }
  1710. sort.Sort(uint64Slice(v2))
  1711. for _, k2 := range v2 {
  1712. e.mapElemKey()
  1713. e.e.EncodeUint(uint64(uint(k2)))
  1714. e.mapElemValue()
  1715. e.e.EncodeUint(v[uint(k2)])
  1716. }
  1717. } else {
  1718. for k2, v2 := range v {
  1719. e.mapElemKey()
  1720. e.e.EncodeUint(uint64(k2))
  1721. e.mapElemValue()
  1722. e.e.EncodeUint(v2)
  1723. }
  1724. }
  1725. e.mapEnd()
  1726. }
  1727. func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  1728. fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e)
  1729. }
  1730. func (fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) {
  1731. if v == nil {
  1732. e.e.EncodeNil()
  1733. return
  1734. }
  1735. e.mapStart(len(v))
  1736. if e.h.Canonical {
  1737. v2 := make([]uint64, len(v))
  1738. var i uint
  1739. for k := range v {
  1740. v2[i] = uint64(k)
  1741. i++
  1742. }
  1743. sort.Sort(uint64Slice(v2))
  1744. for _, k2 := range v2 {
  1745. e.mapElemKey()
  1746. e.e.EncodeUint(uint64(uint(k2)))
  1747. e.mapElemValue()
  1748. e.e.EncodeInt(int64(v[uint(k2)]))
  1749. }
  1750. } else {
  1751. for k2, v2 := range v {
  1752. e.mapElemKey()
  1753. e.e.EncodeUint(uint64(k2))
  1754. e.mapElemValue()
  1755. e.e.EncodeInt(int64(v2))
  1756. }
  1757. }
  1758. e.mapEnd()
  1759. }
  1760. func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  1761. fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e)
  1762. }
  1763. func (fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) {
  1764. if v == nil {
  1765. e.e.EncodeNil()
  1766. return
  1767. }
  1768. e.mapStart(len(v))
  1769. if e.h.Canonical {
  1770. v2 := make([]uint64, len(v))
  1771. var i uint
  1772. for k := range v {
  1773. v2[i] = uint64(k)
  1774. i++
  1775. }
  1776. sort.Sort(uint64Slice(v2))
  1777. for _, k2 := range v2 {
  1778. e.mapElemKey()
  1779. e.e.EncodeUint(uint64(uint(k2)))
  1780. e.mapElemValue()
  1781. e.e.EncodeInt(v[uint(k2)])
  1782. }
  1783. } else {
  1784. for k2, v2 := range v {
  1785. e.mapElemKey()
  1786. e.e.EncodeUint(uint64(k2))
  1787. e.mapElemValue()
  1788. e.e.EncodeInt(v2)
  1789. }
  1790. }
  1791. e.mapEnd()
  1792. }
  1793. func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  1794. fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e)
  1795. }
  1796. func (fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) {
  1797. if v == nil {
  1798. e.e.EncodeNil()
  1799. return
  1800. }
  1801. e.mapStart(len(v))
  1802. if e.h.Canonical {
  1803. v2 := make([]uint64, len(v))
  1804. var i uint
  1805. for k := range v {
  1806. v2[i] = uint64(k)
  1807. i++
  1808. }
  1809. sort.Sort(uint64Slice(v2))
  1810. for _, k2 := range v2 {
  1811. e.mapElemKey()
  1812. e.e.EncodeUint(uint64(uint(k2)))
  1813. e.mapElemValue()
  1814. e.e.EncodeFloat32(v[uint(k2)])
  1815. }
  1816. } else {
  1817. for k2, v2 := range v {
  1818. e.mapElemKey()
  1819. e.e.EncodeUint(uint64(k2))
  1820. e.mapElemValue()
  1821. e.e.EncodeFloat32(v2)
  1822. }
  1823. }
  1824. e.mapEnd()
  1825. }
  1826. func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  1827. fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e)
  1828. }
  1829. func (fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) {
  1830. if v == nil {
  1831. e.e.EncodeNil()
  1832. return
  1833. }
  1834. e.mapStart(len(v))
  1835. if e.h.Canonical {
  1836. v2 := make([]uint64, len(v))
  1837. var i uint
  1838. for k := range v {
  1839. v2[i] = uint64(k)
  1840. i++
  1841. }
  1842. sort.Sort(uint64Slice(v2))
  1843. for _, k2 := range v2 {
  1844. e.mapElemKey()
  1845. e.e.EncodeUint(uint64(uint(k2)))
  1846. e.mapElemValue()
  1847. e.e.EncodeFloat64(v[uint(k2)])
  1848. }
  1849. } else {
  1850. for k2, v2 := range v {
  1851. e.mapElemKey()
  1852. e.e.EncodeUint(uint64(k2))
  1853. e.mapElemValue()
  1854. e.e.EncodeFloat64(v2)
  1855. }
  1856. }
  1857. e.mapEnd()
  1858. }
  1859. func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  1860. fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e)
  1861. }
  1862. func (fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) {
  1863. if v == nil {
  1864. e.e.EncodeNil()
  1865. return
  1866. }
  1867. e.mapStart(len(v))
  1868. if e.h.Canonical {
  1869. v2 := make([]uint64, len(v))
  1870. var i uint
  1871. for k := range v {
  1872. v2[i] = uint64(k)
  1873. i++
  1874. }
  1875. sort.Sort(uint64Slice(v2))
  1876. for _, k2 := range v2 {
  1877. e.mapElemKey()
  1878. e.e.EncodeUint(uint64(uint(k2)))
  1879. e.mapElemValue()
  1880. e.e.EncodeBool(v[uint(k2)])
  1881. }
  1882. } else {
  1883. for k2, v2 := range v {
  1884. e.mapElemKey()
  1885. e.e.EncodeUint(uint64(k2))
  1886. e.mapElemValue()
  1887. e.e.EncodeBool(v2)
  1888. }
  1889. }
  1890. e.mapEnd()
  1891. }
  1892. func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  1893. fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e)
  1894. }
  1895. func (fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) {
  1896. if v == nil {
  1897. e.e.EncodeNil()
  1898. return
  1899. }
  1900. e.mapStart(len(v))
  1901. if e.h.Canonical {
  1902. v2 := make([]uint64, len(v))
  1903. var i uint
  1904. for k := range v {
  1905. v2[i] = uint64(k)
  1906. i++
  1907. }
  1908. sort.Sort(uint64Slice(v2))
  1909. for _, k2 := range v2 {
  1910. e.mapElemKey()
  1911. e.e.EncodeUint(uint64(uint8(k2)))
  1912. e.mapElemValue()
  1913. e.encode(v[uint8(k2)])
  1914. }
  1915. } else {
  1916. for k2, v2 := range v {
  1917. e.mapElemKey()
  1918. e.e.EncodeUint(uint64(k2))
  1919. e.mapElemValue()
  1920. e.encode(v2)
  1921. }
  1922. }
  1923. e.mapEnd()
  1924. }
  1925. func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  1926. fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e)
  1927. }
  1928. func (fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) {
  1929. if v == nil {
  1930. e.e.EncodeNil()
  1931. return
  1932. }
  1933. e.mapStart(len(v))
  1934. if e.h.Canonical {
  1935. v2 := make([]uint64, len(v))
  1936. var i uint
  1937. for k := range v {
  1938. v2[i] = uint64(k)
  1939. i++
  1940. }
  1941. sort.Sort(uint64Slice(v2))
  1942. for _, k2 := range v2 {
  1943. e.mapElemKey()
  1944. e.e.EncodeUint(uint64(uint8(k2)))
  1945. e.mapElemValue()
  1946. if e.h.StringToRaw {
  1947. e.e.EncodeStringBytesRaw(bytesView(v[uint8(k2)]))
  1948. } else {
  1949. e.e.EncodeStringEnc(cUTF8, v[uint8(k2)])
  1950. }
  1951. }
  1952. } else {
  1953. for k2, v2 := range v {
  1954. e.mapElemKey()
  1955. e.e.EncodeUint(uint64(k2))
  1956. e.mapElemValue()
  1957. if e.h.StringToRaw {
  1958. e.e.EncodeStringBytesRaw(bytesView(v2))
  1959. } else {
  1960. e.e.EncodeStringEnc(cUTF8, v2)
  1961. }
  1962. }
  1963. }
  1964. e.mapEnd()
  1965. }
  1966. func (e *Encoder) fastpathEncMapUint8BytesR(f *codecFnInfo, rv reflect.Value) {
  1967. fastpathTV.EncMapUint8BytesV(rv2i(rv).(map[uint8][]byte), e)
  1968. }
  1969. func (fastpathT) EncMapUint8BytesV(v map[uint8][]byte, e *Encoder) {
  1970. if v == nil {
  1971. e.e.EncodeNil()
  1972. return
  1973. }
  1974. e.mapStart(len(v))
  1975. if e.h.Canonical {
  1976. v2 := make([]uint64, len(v))
  1977. var i uint
  1978. for k := range v {
  1979. v2[i] = uint64(k)
  1980. i++
  1981. }
  1982. sort.Sort(uint64Slice(v2))
  1983. for _, k2 := range v2 {
  1984. e.mapElemKey()
  1985. e.e.EncodeUint(uint64(uint8(k2)))
  1986. e.mapElemValue()
  1987. e.e.EncodeStringBytesRaw(v[uint8(k2)])
  1988. }
  1989. } else {
  1990. for k2, v2 := range v {
  1991. e.mapElemKey()
  1992. e.e.EncodeUint(uint64(k2))
  1993. e.mapElemValue()
  1994. e.e.EncodeStringBytesRaw(v2)
  1995. }
  1996. }
  1997. e.mapEnd()
  1998. }
  1999. func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  2000. fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e)
  2001. }
  2002. func (fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) {
  2003. if v == nil {
  2004. e.e.EncodeNil()
  2005. return
  2006. }
  2007. e.mapStart(len(v))
  2008. if e.h.Canonical {
  2009. v2 := make([]uint64, len(v))
  2010. var i uint
  2011. for k := range v {
  2012. v2[i] = uint64(k)
  2013. i++
  2014. }
  2015. sort.Sort(uint64Slice(v2))
  2016. for _, k2 := range v2 {
  2017. e.mapElemKey()
  2018. e.e.EncodeUint(uint64(uint8(k2)))
  2019. e.mapElemValue()
  2020. e.e.EncodeUint(uint64(v[uint8(k2)]))
  2021. }
  2022. } else {
  2023. for k2, v2 := range v {
  2024. e.mapElemKey()
  2025. e.e.EncodeUint(uint64(k2))
  2026. e.mapElemValue()
  2027. e.e.EncodeUint(uint64(v2))
  2028. }
  2029. }
  2030. e.mapEnd()
  2031. }
  2032. func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  2033. fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e)
  2034. }
  2035. func (fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) {
  2036. if v == nil {
  2037. e.e.EncodeNil()
  2038. return
  2039. }
  2040. e.mapStart(len(v))
  2041. if e.h.Canonical {
  2042. v2 := make([]uint64, len(v))
  2043. var i uint
  2044. for k := range v {
  2045. v2[i] = uint64(k)
  2046. i++
  2047. }
  2048. sort.Sort(uint64Slice(v2))
  2049. for _, k2 := range v2 {
  2050. e.mapElemKey()
  2051. e.e.EncodeUint(uint64(uint8(k2)))
  2052. e.mapElemValue()
  2053. e.e.EncodeUint(uint64(v[uint8(k2)]))
  2054. }
  2055. } else {
  2056. for k2, v2 := range v {
  2057. e.mapElemKey()
  2058. e.e.EncodeUint(uint64(k2))
  2059. e.mapElemValue()
  2060. e.e.EncodeUint(uint64(v2))
  2061. }
  2062. }
  2063. e.mapEnd()
  2064. }
  2065. func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  2066. fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e)
  2067. }
  2068. func (fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) {
  2069. if v == nil {
  2070. e.e.EncodeNil()
  2071. return
  2072. }
  2073. e.mapStart(len(v))
  2074. if e.h.Canonical {
  2075. v2 := make([]uint64, len(v))
  2076. var i uint
  2077. for k := range v {
  2078. v2[i] = uint64(k)
  2079. i++
  2080. }
  2081. sort.Sort(uint64Slice(v2))
  2082. for _, k2 := range v2 {
  2083. e.mapElemKey()
  2084. e.e.EncodeUint(uint64(uint8(k2)))
  2085. e.mapElemValue()
  2086. e.e.EncodeUint(v[uint8(k2)])
  2087. }
  2088. } else {
  2089. for k2, v2 := range v {
  2090. e.mapElemKey()
  2091. e.e.EncodeUint(uint64(k2))
  2092. e.mapElemValue()
  2093. e.e.EncodeUint(v2)
  2094. }
  2095. }
  2096. e.mapEnd()
  2097. }
  2098. func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  2099. fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e)
  2100. }
  2101. func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) {
  2102. if v == nil {
  2103. e.e.EncodeNil()
  2104. return
  2105. }
  2106. e.mapStart(len(v))
  2107. if e.h.Canonical {
  2108. v2 := make([]uint64, len(v))
  2109. var i uint
  2110. for k := range v {
  2111. v2[i] = uint64(k)
  2112. i++
  2113. }
  2114. sort.Sort(uint64Slice(v2))
  2115. for _, k2 := range v2 {
  2116. e.mapElemKey()
  2117. e.e.EncodeUint(uint64(uint8(k2)))
  2118. e.mapElemValue()
  2119. e.e.EncodeInt(int64(v[uint8(k2)]))
  2120. }
  2121. } else {
  2122. for k2, v2 := range v {
  2123. e.mapElemKey()
  2124. e.e.EncodeUint(uint64(k2))
  2125. e.mapElemValue()
  2126. e.e.EncodeInt(int64(v2))
  2127. }
  2128. }
  2129. e.mapEnd()
  2130. }
  2131. func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  2132. fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e)
  2133. }
  2134. func (fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) {
  2135. if v == nil {
  2136. e.e.EncodeNil()
  2137. return
  2138. }
  2139. e.mapStart(len(v))
  2140. if e.h.Canonical {
  2141. v2 := make([]uint64, len(v))
  2142. var i uint
  2143. for k := range v {
  2144. v2[i] = uint64(k)
  2145. i++
  2146. }
  2147. sort.Sort(uint64Slice(v2))
  2148. for _, k2 := range v2 {
  2149. e.mapElemKey()
  2150. e.e.EncodeUint(uint64(uint8(k2)))
  2151. e.mapElemValue()
  2152. e.e.EncodeInt(v[uint8(k2)])
  2153. }
  2154. } else {
  2155. for k2, v2 := range v {
  2156. e.mapElemKey()
  2157. e.e.EncodeUint(uint64(k2))
  2158. e.mapElemValue()
  2159. e.e.EncodeInt(v2)
  2160. }
  2161. }
  2162. e.mapEnd()
  2163. }
  2164. func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  2165. fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e)
  2166. }
  2167. func (fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) {
  2168. if v == nil {
  2169. e.e.EncodeNil()
  2170. return
  2171. }
  2172. e.mapStart(len(v))
  2173. if e.h.Canonical {
  2174. v2 := make([]uint64, len(v))
  2175. var i uint
  2176. for k := range v {
  2177. v2[i] = uint64(k)
  2178. i++
  2179. }
  2180. sort.Sort(uint64Slice(v2))
  2181. for _, k2 := range v2 {
  2182. e.mapElemKey()
  2183. e.e.EncodeUint(uint64(uint8(k2)))
  2184. e.mapElemValue()
  2185. e.e.EncodeFloat32(v[uint8(k2)])
  2186. }
  2187. } else {
  2188. for k2, v2 := range v {
  2189. e.mapElemKey()
  2190. e.e.EncodeUint(uint64(k2))
  2191. e.mapElemValue()
  2192. e.e.EncodeFloat32(v2)
  2193. }
  2194. }
  2195. e.mapEnd()
  2196. }
  2197. func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  2198. fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e)
  2199. }
  2200. func (fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) {
  2201. if v == nil {
  2202. e.e.EncodeNil()
  2203. return
  2204. }
  2205. e.mapStart(len(v))
  2206. if e.h.Canonical {
  2207. v2 := make([]uint64, len(v))
  2208. var i uint
  2209. for k := range v {
  2210. v2[i] = uint64(k)
  2211. i++
  2212. }
  2213. sort.Sort(uint64Slice(v2))
  2214. for _, k2 := range v2 {
  2215. e.mapElemKey()
  2216. e.e.EncodeUint(uint64(uint8(k2)))
  2217. e.mapElemValue()
  2218. e.e.EncodeFloat64(v[uint8(k2)])
  2219. }
  2220. } else {
  2221. for k2, v2 := range v {
  2222. e.mapElemKey()
  2223. e.e.EncodeUint(uint64(k2))
  2224. e.mapElemValue()
  2225. e.e.EncodeFloat64(v2)
  2226. }
  2227. }
  2228. e.mapEnd()
  2229. }
  2230. func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  2231. fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e)
  2232. }
  2233. func (fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) {
  2234. if v == nil {
  2235. e.e.EncodeNil()
  2236. return
  2237. }
  2238. e.mapStart(len(v))
  2239. if e.h.Canonical {
  2240. v2 := make([]uint64, len(v))
  2241. var i uint
  2242. for k := range v {
  2243. v2[i] = uint64(k)
  2244. i++
  2245. }
  2246. sort.Sort(uint64Slice(v2))
  2247. for _, k2 := range v2 {
  2248. e.mapElemKey()
  2249. e.e.EncodeUint(uint64(uint8(k2)))
  2250. e.mapElemValue()
  2251. e.e.EncodeBool(v[uint8(k2)])
  2252. }
  2253. } else {
  2254. for k2, v2 := range v {
  2255. e.mapElemKey()
  2256. e.e.EncodeUint(uint64(k2))
  2257. e.mapElemValue()
  2258. e.e.EncodeBool(v2)
  2259. }
  2260. }
  2261. e.mapEnd()
  2262. }
  2263. func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  2264. fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e)
  2265. }
  2266. func (fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) {
  2267. if v == nil {
  2268. e.e.EncodeNil()
  2269. return
  2270. }
  2271. e.mapStart(len(v))
  2272. if e.h.Canonical {
  2273. v2 := make([]uint64, len(v))
  2274. var i uint
  2275. for k := range v {
  2276. v2[i] = k
  2277. i++
  2278. }
  2279. sort.Sort(uint64Slice(v2))
  2280. for _, k2 := range v2 {
  2281. e.mapElemKey()
  2282. e.e.EncodeUint(k2)
  2283. e.mapElemValue()
  2284. e.encode(v[k2])
  2285. }
  2286. } else {
  2287. for k2, v2 := range v {
  2288. e.mapElemKey()
  2289. e.e.EncodeUint(k2)
  2290. e.mapElemValue()
  2291. e.encode(v2)
  2292. }
  2293. }
  2294. e.mapEnd()
  2295. }
  2296. func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  2297. fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e)
  2298. }
  2299. func (fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) {
  2300. if v == nil {
  2301. e.e.EncodeNil()
  2302. return
  2303. }
  2304. e.mapStart(len(v))
  2305. if e.h.Canonical {
  2306. v2 := make([]uint64, len(v))
  2307. var i uint
  2308. for k := range v {
  2309. v2[i] = k
  2310. i++
  2311. }
  2312. sort.Sort(uint64Slice(v2))
  2313. for _, k2 := range v2 {
  2314. e.mapElemKey()
  2315. e.e.EncodeUint(k2)
  2316. e.mapElemValue()
  2317. if e.h.StringToRaw {
  2318. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  2319. } else {
  2320. e.e.EncodeStringEnc(cUTF8, v[k2])
  2321. }
  2322. }
  2323. } else {
  2324. for k2, v2 := range v {
  2325. e.mapElemKey()
  2326. e.e.EncodeUint(k2)
  2327. e.mapElemValue()
  2328. if e.h.StringToRaw {
  2329. e.e.EncodeStringBytesRaw(bytesView(v2))
  2330. } else {
  2331. e.e.EncodeStringEnc(cUTF8, v2)
  2332. }
  2333. }
  2334. }
  2335. e.mapEnd()
  2336. }
  2337. func (e *Encoder) fastpathEncMapUint64BytesR(f *codecFnInfo, rv reflect.Value) {
  2338. fastpathTV.EncMapUint64BytesV(rv2i(rv).(map[uint64][]byte), e)
  2339. }
  2340. func (fastpathT) EncMapUint64BytesV(v map[uint64][]byte, e *Encoder) {
  2341. if v == nil {
  2342. e.e.EncodeNil()
  2343. return
  2344. }
  2345. e.mapStart(len(v))
  2346. if e.h.Canonical {
  2347. v2 := make([]uint64, len(v))
  2348. var i uint
  2349. for k := range v {
  2350. v2[i] = k
  2351. i++
  2352. }
  2353. sort.Sort(uint64Slice(v2))
  2354. for _, k2 := range v2 {
  2355. e.mapElemKey()
  2356. e.e.EncodeUint(k2)
  2357. e.mapElemValue()
  2358. e.e.EncodeStringBytesRaw(v[k2])
  2359. }
  2360. } else {
  2361. for k2, v2 := range v {
  2362. e.mapElemKey()
  2363. e.e.EncodeUint(k2)
  2364. e.mapElemValue()
  2365. e.e.EncodeStringBytesRaw(v2)
  2366. }
  2367. }
  2368. e.mapEnd()
  2369. }
  2370. func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  2371. fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e)
  2372. }
  2373. func (fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) {
  2374. if v == nil {
  2375. e.e.EncodeNil()
  2376. return
  2377. }
  2378. e.mapStart(len(v))
  2379. if e.h.Canonical {
  2380. v2 := make([]uint64, len(v))
  2381. var i uint
  2382. for k := range v {
  2383. v2[i] = k
  2384. i++
  2385. }
  2386. sort.Sort(uint64Slice(v2))
  2387. for _, k2 := range v2 {
  2388. e.mapElemKey()
  2389. e.e.EncodeUint(k2)
  2390. e.mapElemValue()
  2391. e.e.EncodeUint(uint64(v[k2]))
  2392. }
  2393. } else {
  2394. for k2, v2 := range v {
  2395. e.mapElemKey()
  2396. e.e.EncodeUint(k2)
  2397. e.mapElemValue()
  2398. e.e.EncodeUint(uint64(v2))
  2399. }
  2400. }
  2401. e.mapEnd()
  2402. }
  2403. func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  2404. fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e)
  2405. }
  2406. func (fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) {
  2407. if v == nil {
  2408. e.e.EncodeNil()
  2409. return
  2410. }
  2411. e.mapStart(len(v))
  2412. if e.h.Canonical {
  2413. v2 := make([]uint64, len(v))
  2414. var i uint
  2415. for k := range v {
  2416. v2[i] = k
  2417. i++
  2418. }
  2419. sort.Sort(uint64Slice(v2))
  2420. for _, k2 := range v2 {
  2421. e.mapElemKey()
  2422. e.e.EncodeUint(k2)
  2423. e.mapElemValue()
  2424. e.e.EncodeUint(uint64(v[k2]))
  2425. }
  2426. } else {
  2427. for k2, v2 := range v {
  2428. e.mapElemKey()
  2429. e.e.EncodeUint(k2)
  2430. e.mapElemValue()
  2431. e.e.EncodeUint(uint64(v2))
  2432. }
  2433. }
  2434. e.mapEnd()
  2435. }
  2436. func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  2437. fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e)
  2438. }
  2439. func (fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) {
  2440. if v == nil {
  2441. e.e.EncodeNil()
  2442. return
  2443. }
  2444. e.mapStart(len(v))
  2445. if e.h.Canonical {
  2446. v2 := make([]uint64, len(v))
  2447. var i uint
  2448. for k := range v {
  2449. v2[i] = k
  2450. i++
  2451. }
  2452. sort.Sort(uint64Slice(v2))
  2453. for _, k2 := range v2 {
  2454. e.mapElemKey()
  2455. e.e.EncodeUint(k2)
  2456. e.mapElemValue()
  2457. e.e.EncodeUint(v[k2])
  2458. }
  2459. } else {
  2460. for k2, v2 := range v {
  2461. e.mapElemKey()
  2462. e.e.EncodeUint(k2)
  2463. e.mapElemValue()
  2464. e.e.EncodeUint(v2)
  2465. }
  2466. }
  2467. e.mapEnd()
  2468. }
  2469. func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  2470. fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e)
  2471. }
  2472. func (fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) {
  2473. if v == nil {
  2474. e.e.EncodeNil()
  2475. return
  2476. }
  2477. e.mapStart(len(v))
  2478. if e.h.Canonical {
  2479. v2 := make([]uint64, len(v))
  2480. var i uint
  2481. for k := range v {
  2482. v2[i] = k
  2483. i++
  2484. }
  2485. sort.Sort(uint64Slice(v2))
  2486. for _, k2 := range v2 {
  2487. e.mapElemKey()
  2488. e.e.EncodeUint(k2)
  2489. e.mapElemValue()
  2490. e.e.EncodeInt(int64(v[k2]))
  2491. }
  2492. } else {
  2493. for k2, v2 := range v {
  2494. e.mapElemKey()
  2495. e.e.EncodeUint(k2)
  2496. e.mapElemValue()
  2497. e.e.EncodeInt(int64(v2))
  2498. }
  2499. }
  2500. e.mapEnd()
  2501. }
  2502. func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  2503. fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e)
  2504. }
  2505. func (fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) {
  2506. if v == nil {
  2507. e.e.EncodeNil()
  2508. return
  2509. }
  2510. e.mapStart(len(v))
  2511. if e.h.Canonical {
  2512. v2 := make([]uint64, len(v))
  2513. var i uint
  2514. for k := range v {
  2515. v2[i] = k
  2516. i++
  2517. }
  2518. sort.Sort(uint64Slice(v2))
  2519. for _, k2 := range v2 {
  2520. e.mapElemKey()
  2521. e.e.EncodeUint(k2)
  2522. e.mapElemValue()
  2523. e.e.EncodeInt(v[k2])
  2524. }
  2525. } else {
  2526. for k2, v2 := range v {
  2527. e.mapElemKey()
  2528. e.e.EncodeUint(k2)
  2529. e.mapElemValue()
  2530. e.e.EncodeInt(v2)
  2531. }
  2532. }
  2533. e.mapEnd()
  2534. }
  2535. func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  2536. fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e)
  2537. }
  2538. func (fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) {
  2539. if v == nil {
  2540. e.e.EncodeNil()
  2541. return
  2542. }
  2543. e.mapStart(len(v))
  2544. if e.h.Canonical {
  2545. v2 := make([]uint64, len(v))
  2546. var i uint
  2547. for k := range v {
  2548. v2[i] = k
  2549. i++
  2550. }
  2551. sort.Sort(uint64Slice(v2))
  2552. for _, k2 := range v2 {
  2553. e.mapElemKey()
  2554. e.e.EncodeUint(k2)
  2555. e.mapElemValue()
  2556. e.e.EncodeFloat32(v[k2])
  2557. }
  2558. } else {
  2559. for k2, v2 := range v {
  2560. e.mapElemKey()
  2561. e.e.EncodeUint(k2)
  2562. e.mapElemValue()
  2563. e.e.EncodeFloat32(v2)
  2564. }
  2565. }
  2566. e.mapEnd()
  2567. }
  2568. func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  2569. fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e)
  2570. }
  2571. func (fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) {
  2572. if v == nil {
  2573. e.e.EncodeNil()
  2574. return
  2575. }
  2576. e.mapStart(len(v))
  2577. if e.h.Canonical {
  2578. v2 := make([]uint64, len(v))
  2579. var i uint
  2580. for k := range v {
  2581. v2[i] = k
  2582. i++
  2583. }
  2584. sort.Sort(uint64Slice(v2))
  2585. for _, k2 := range v2 {
  2586. e.mapElemKey()
  2587. e.e.EncodeUint(k2)
  2588. e.mapElemValue()
  2589. e.e.EncodeFloat64(v[k2])
  2590. }
  2591. } else {
  2592. for k2, v2 := range v {
  2593. e.mapElemKey()
  2594. e.e.EncodeUint(k2)
  2595. e.mapElemValue()
  2596. e.e.EncodeFloat64(v2)
  2597. }
  2598. }
  2599. e.mapEnd()
  2600. }
  2601. func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  2602. fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e)
  2603. }
  2604. func (fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) {
  2605. if v == nil {
  2606. e.e.EncodeNil()
  2607. return
  2608. }
  2609. e.mapStart(len(v))
  2610. if e.h.Canonical {
  2611. v2 := make([]uint64, len(v))
  2612. var i uint
  2613. for k := range v {
  2614. v2[i] = k
  2615. i++
  2616. }
  2617. sort.Sort(uint64Slice(v2))
  2618. for _, k2 := range v2 {
  2619. e.mapElemKey()
  2620. e.e.EncodeUint(k2)
  2621. e.mapElemValue()
  2622. e.e.EncodeBool(v[k2])
  2623. }
  2624. } else {
  2625. for k2, v2 := range v {
  2626. e.mapElemKey()
  2627. e.e.EncodeUint(k2)
  2628. e.mapElemValue()
  2629. e.e.EncodeBool(v2)
  2630. }
  2631. }
  2632. e.mapEnd()
  2633. }
  2634. func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  2635. fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e)
  2636. }
  2637. func (fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) {
  2638. if v == nil {
  2639. e.e.EncodeNil()
  2640. return
  2641. }
  2642. e.mapStart(len(v))
  2643. if e.h.Canonical {
  2644. v2 := make([]int64, len(v))
  2645. var i uint
  2646. for k := range v {
  2647. v2[i] = int64(k)
  2648. i++
  2649. }
  2650. sort.Sort(int64Slice(v2))
  2651. for _, k2 := range v2 {
  2652. e.mapElemKey()
  2653. e.e.EncodeInt(int64(int(k2)))
  2654. e.mapElemValue()
  2655. e.encode(v[int(k2)])
  2656. }
  2657. } else {
  2658. for k2, v2 := range v {
  2659. e.mapElemKey()
  2660. e.e.EncodeInt(int64(k2))
  2661. e.mapElemValue()
  2662. e.encode(v2)
  2663. }
  2664. }
  2665. e.mapEnd()
  2666. }
  2667. func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  2668. fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e)
  2669. }
  2670. func (fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) {
  2671. if v == nil {
  2672. e.e.EncodeNil()
  2673. return
  2674. }
  2675. e.mapStart(len(v))
  2676. if e.h.Canonical {
  2677. v2 := make([]int64, len(v))
  2678. var i uint
  2679. for k := range v {
  2680. v2[i] = int64(k)
  2681. i++
  2682. }
  2683. sort.Sort(int64Slice(v2))
  2684. for _, k2 := range v2 {
  2685. e.mapElemKey()
  2686. e.e.EncodeInt(int64(int(k2)))
  2687. e.mapElemValue()
  2688. if e.h.StringToRaw {
  2689. e.e.EncodeStringBytesRaw(bytesView(v[int(k2)]))
  2690. } else {
  2691. e.e.EncodeStringEnc(cUTF8, v[int(k2)])
  2692. }
  2693. }
  2694. } else {
  2695. for k2, v2 := range v {
  2696. e.mapElemKey()
  2697. e.e.EncodeInt(int64(k2))
  2698. e.mapElemValue()
  2699. if e.h.StringToRaw {
  2700. e.e.EncodeStringBytesRaw(bytesView(v2))
  2701. } else {
  2702. e.e.EncodeStringEnc(cUTF8, v2)
  2703. }
  2704. }
  2705. }
  2706. e.mapEnd()
  2707. }
  2708. func (e *Encoder) fastpathEncMapIntBytesR(f *codecFnInfo, rv reflect.Value) {
  2709. fastpathTV.EncMapIntBytesV(rv2i(rv).(map[int][]byte), e)
  2710. }
  2711. func (fastpathT) EncMapIntBytesV(v map[int][]byte, e *Encoder) {
  2712. if v == nil {
  2713. e.e.EncodeNil()
  2714. return
  2715. }
  2716. e.mapStart(len(v))
  2717. if e.h.Canonical {
  2718. v2 := make([]int64, len(v))
  2719. var i uint
  2720. for k := range v {
  2721. v2[i] = int64(k)
  2722. i++
  2723. }
  2724. sort.Sort(int64Slice(v2))
  2725. for _, k2 := range v2 {
  2726. e.mapElemKey()
  2727. e.e.EncodeInt(int64(int(k2)))
  2728. e.mapElemValue()
  2729. e.e.EncodeStringBytesRaw(v[int(k2)])
  2730. }
  2731. } else {
  2732. for k2, v2 := range v {
  2733. e.mapElemKey()
  2734. e.e.EncodeInt(int64(k2))
  2735. e.mapElemValue()
  2736. e.e.EncodeStringBytesRaw(v2)
  2737. }
  2738. }
  2739. e.mapEnd()
  2740. }
  2741. func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  2742. fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e)
  2743. }
  2744. func (fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) {
  2745. if v == nil {
  2746. e.e.EncodeNil()
  2747. return
  2748. }
  2749. e.mapStart(len(v))
  2750. if e.h.Canonical {
  2751. v2 := make([]int64, len(v))
  2752. var i uint
  2753. for k := range v {
  2754. v2[i] = int64(k)
  2755. i++
  2756. }
  2757. sort.Sort(int64Slice(v2))
  2758. for _, k2 := range v2 {
  2759. e.mapElemKey()
  2760. e.e.EncodeInt(int64(int(k2)))
  2761. e.mapElemValue()
  2762. e.e.EncodeUint(uint64(v[int(k2)]))
  2763. }
  2764. } else {
  2765. for k2, v2 := range v {
  2766. e.mapElemKey()
  2767. e.e.EncodeInt(int64(k2))
  2768. e.mapElemValue()
  2769. e.e.EncodeUint(uint64(v2))
  2770. }
  2771. }
  2772. e.mapEnd()
  2773. }
  2774. func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  2775. fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e)
  2776. }
  2777. func (fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) {
  2778. if v == nil {
  2779. e.e.EncodeNil()
  2780. return
  2781. }
  2782. e.mapStart(len(v))
  2783. if e.h.Canonical {
  2784. v2 := make([]int64, len(v))
  2785. var i uint
  2786. for k := range v {
  2787. v2[i] = int64(k)
  2788. i++
  2789. }
  2790. sort.Sort(int64Slice(v2))
  2791. for _, k2 := range v2 {
  2792. e.mapElemKey()
  2793. e.e.EncodeInt(int64(int(k2)))
  2794. e.mapElemValue()
  2795. e.e.EncodeUint(uint64(v[int(k2)]))
  2796. }
  2797. } else {
  2798. for k2, v2 := range v {
  2799. e.mapElemKey()
  2800. e.e.EncodeInt(int64(k2))
  2801. e.mapElemValue()
  2802. e.e.EncodeUint(uint64(v2))
  2803. }
  2804. }
  2805. e.mapEnd()
  2806. }
  2807. func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  2808. fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e)
  2809. }
  2810. func (fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) {
  2811. if v == nil {
  2812. e.e.EncodeNil()
  2813. return
  2814. }
  2815. e.mapStart(len(v))
  2816. if e.h.Canonical {
  2817. v2 := make([]int64, len(v))
  2818. var i uint
  2819. for k := range v {
  2820. v2[i] = int64(k)
  2821. i++
  2822. }
  2823. sort.Sort(int64Slice(v2))
  2824. for _, k2 := range v2 {
  2825. e.mapElemKey()
  2826. e.e.EncodeInt(int64(int(k2)))
  2827. e.mapElemValue()
  2828. e.e.EncodeUint(v[int(k2)])
  2829. }
  2830. } else {
  2831. for k2, v2 := range v {
  2832. e.mapElemKey()
  2833. e.e.EncodeInt(int64(k2))
  2834. e.mapElemValue()
  2835. e.e.EncodeUint(v2)
  2836. }
  2837. }
  2838. e.mapEnd()
  2839. }
  2840. func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  2841. fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e)
  2842. }
  2843. func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) {
  2844. if v == nil {
  2845. e.e.EncodeNil()
  2846. return
  2847. }
  2848. e.mapStart(len(v))
  2849. if e.h.Canonical {
  2850. v2 := make([]int64, len(v))
  2851. var i uint
  2852. for k := range v {
  2853. v2[i] = int64(k)
  2854. i++
  2855. }
  2856. sort.Sort(int64Slice(v2))
  2857. for _, k2 := range v2 {
  2858. e.mapElemKey()
  2859. e.e.EncodeInt(int64(int(k2)))
  2860. e.mapElemValue()
  2861. e.e.EncodeInt(int64(v[int(k2)]))
  2862. }
  2863. } else {
  2864. for k2, v2 := range v {
  2865. e.mapElemKey()
  2866. e.e.EncodeInt(int64(k2))
  2867. e.mapElemValue()
  2868. e.e.EncodeInt(int64(v2))
  2869. }
  2870. }
  2871. e.mapEnd()
  2872. }
  2873. func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  2874. fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e)
  2875. }
  2876. func (fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) {
  2877. if v == nil {
  2878. e.e.EncodeNil()
  2879. return
  2880. }
  2881. e.mapStart(len(v))
  2882. if e.h.Canonical {
  2883. v2 := make([]int64, len(v))
  2884. var i uint
  2885. for k := range v {
  2886. v2[i] = int64(k)
  2887. i++
  2888. }
  2889. sort.Sort(int64Slice(v2))
  2890. for _, k2 := range v2 {
  2891. e.mapElemKey()
  2892. e.e.EncodeInt(int64(int(k2)))
  2893. e.mapElemValue()
  2894. e.e.EncodeInt(v[int(k2)])
  2895. }
  2896. } else {
  2897. for k2, v2 := range v {
  2898. e.mapElemKey()
  2899. e.e.EncodeInt(int64(k2))
  2900. e.mapElemValue()
  2901. e.e.EncodeInt(v2)
  2902. }
  2903. }
  2904. e.mapEnd()
  2905. }
  2906. func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  2907. fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e)
  2908. }
  2909. func (fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) {
  2910. if v == nil {
  2911. e.e.EncodeNil()
  2912. return
  2913. }
  2914. e.mapStart(len(v))
  2915. if e.h.Canonical {
  2916. v2 := make([]int64, len(v))
  2917. var i uint
  2918. for k := range v {
  2919. v2[i] = int64(k)
  2920. i++
  2921. }
  2922. sort.Sort(int64Slice(v2))
  2923. for _, k2 := range v2 {
  2924. e.mapElemKey()
  2925. e.e.EncodeInt(int64(int(k2)))
  2926. e.mapElemValue()
  2927. e.e.EncodeFloat32(v[int(k2)])
  2928. }
  2929. } else {
  2930. for k2, v2 := range v {
  2931. e.mapElemKey()
  2932. e.e.EncodeInt(int64(k2))
  2933. e.mapElemValue()
  2934. e.e.EncodeFloat32(v2)
  2935. }
  2936. }
  2937. e.mapEnd()
  2938. }
  2939. func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  2940. fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e)
  2941. }
  2942. func (fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) {
  2943. if v == nil {
  2944. e.e.EncodeNil()
  2945. return
  2946. }
  2947. e.mapStart(len(v))
  2948. if e.h.Canonical {
  2949. v2 := make([]int64, len(v))
  2950. var i uint
  2951. for k := range v {
  2952. v2[i] = int64(k)
  2953. i++
  2954. }
  2955. sort.Sort(int64Slice(v2))
  2956. for _, k2 := range v2 {
  2957. e.mapElemKey()
  2958. e.e.EncodeInt(int64(int(k2)))
  2959. e.mapElemValue()
  2960. e.e.EncodeFloat64(v[int(k2)])
  2961. }
  2962. } else {
  2963. for k2, v2 := range v {
  2964. e.mapElemKey()
  2965. e.e.EncodeInt(int64(k2))
  2966. e.mapElemValue()
  2967. e.e.EncodeFloat64(v2)
  2968. }
  2969. }
  2970. e.mapEnd()
  2971. }
  2972. func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  2973. fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e)
  2974. }
  2975. func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) {
  2976. if v == nil {
  2977. e.e.EncodeNil()
  2978. return
  2979. }
  2980. e.mapStart(len(v))
  2981. if e.h.Canonical {
  2982. v2 := make([]int64, len(v))
  2983. var i uint
  2984. for k := range v {
  2985. v2[i] = int64(k)
  2986. i++
  2987. }
  2988. sort.Sort(int64Slice(v2))
  2989. for _, k2 := range v2 {
  2990. e.mapElemKey()
  2991. e.e.EncodeInt(int64(int(k2)))
  2992. e.mapElemValue()
  2993. e.e.EncodeBool(v[int(k2)])
  2994. }
  2995. } else {
  2996. for k2, v2 := range v {
  2997. e.mapElemKey()
  2998. e.e.EncodeInt(int64(k2))
  2999. e.mapElemValue()
  3000. e.e.EncodeBool(v2)
  3001. }
  3002. }
  3003. e.mapEnd()
  3004. }
  3005. func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  3006. fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e)
  3007. }
  3008. func (fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) {
  3009. if v == nil {
  3010. e.e.EncodeNil()
  3011. return
  3012. }
  3013. e.mapStart(len(v))
  3014. if e.h.Canonical {
  3015. v2 := make([]int64, len(v))
  3016. var i uint
  3017. for k := range v {
  3018. v2[i] = k
  3019. i++
  3020. }
  3021. sort.Sort(int64Slice(v2))
  3022. for _, k2 := range v2 {
  3023. e.mapElemKey()
  3024. e.e.EncodeInt(k2)
  3025. e.mapElemValue()
  3026. e.encode(v[k2])
  3027. }
  3028. } else {
  3029. for k2, v2 := range v {
  3030. e.mapElemKey()
  3031. e.e.EncodeInt(k2)
  3032. e.mapElemValue()
  3033. e.encode(v2)
  3034. }
  3035. }
  3036. e.mapEnd()
  3037. }
  3038. func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  3039. fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e)
  3040. }
  3041. func (fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) {
  3042. if v == nil {
  3043. e.e.EncodeNil()
  3044. return
  3045. }
  3046. e.mapStart(len(v))
  3047. if e.h.Canonical {
  3048. v2 := make([]int64, len(v))
  3049. var i uint
  3050. for k := range v {
  3051. v2[i] = k
  3052. i++
  3053. }
  3054. sort.Sort(int64Slice(v2))
  3055. for _, k2 := range v2 {
  3056. e.mapElemKey()
  3057. e.e.EncodeInt(k2)
  3058. e.mapElemValue()
  3059. if e.h.StringToRaw {
  3060. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  3061. } else {
  3062. e.e.EncodeStringEnc(cUTF8, v[k2])
  3063. }
  3064. }
  3065. } else {
  3066. for k2, v2 := range v {
  3067. e.mapElemKey()
  3068. e.e.EncodeInt(k2)
  3069. e.mapElemValue()
  3070. if e.h.StringToRaw {
  3071. e.e.EncodeStringBytesRaw(bytesView(v2))
  3072. } else {
  3073. e.e.EncodeStringEnc(cUTF8, v2)
  3074. }
  3075. }
  3076. }
  3077. e.mapEnd()
  3078. }
  3079. func (e *Encoder) fastpathEncMapInt64BytesR(f *codecFnInfo, rv reflect.Value) {
  3080. fastpathTV.EncMapInt64BytesV(rv2i(rv).(map[int64][]byte), e)
  3081. }
  3082. func (fastpathT) EncMapInt64BytesV(v map[int64][]byte, e *Encoder) {
  3083. if v == nil {
  3084. e.e.EncodeNil()
  3085. return
  3086. }
  3087. e.mapStart(len(v))
  3088. if e.h.Canonical {
  3089. v2 := make([]int64, len(v))
  3090. var i uint
  3091. for k := range v {
  3092. v2[i] = k
  3093. i++
  3094. }
  3095. sort.Sort(int64Slice(v2))
  3096. for _, k2 := range v2 {
  3097. e.mapElemKey()
  3098. e.e.EncodeInt(k2)
  3099. e.mapElemValue()
  3100. e.e.EncodeStringBytesRaw(v[k2])
  3101. }
  3102. } else {
  3103. for k2, v2 := range v {
  3104. e.mapElemKey()
  3105. e.e.EncodeInt(k2)
  3106. e.mapElemValue()
  3107. e.e.EncodeStringBytesRaw(v2)
  3108. }
  3109. }
  3110. e.mapEnd()
  3111. }
  3112. func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  3113. fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e)
  3114. }
  3115. func (fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) {
  3116. if v == nil {
  3117. e.e.EncodeNil()
  3118. return
  3119. }
  3120. e.mapStart(len(v))
  3121. if e.h.Canonical {
  3122. v2 := make([]int64, len(v))
  3123. var i uint
  3124. for k := range v {
  3125. v2[i] = k
  3126. i++
  3127. }
  3128. sort.Sort(int64Slice(v2))
  3129. for _, k2 := range v2 {
  3130. e.mapElemKey()
  3131. e.e.EncodeInt(k2)
  3132. e.mapElemValue()
  3133. e.e.EncodeUint(uint64(v[k2]))
  3134. }
  3135. } else {
  3136. for k2, v2 := range v {
  3137. e.mapElemKey()
  3138. e.e.EncodeInt(k2)
  3139. e.mapElemValue()
  3140. e.e.EncodeUint(uint64(v2))
  3141. }
  3142. }
  3143. e.mapEnd()
  3144. }
  3145. func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  3146. fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e)
  3147. }
  3148. func (fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) {
  3149. if v == nil {
  3150. e.e.EncodeNil()
  3151. return
  3152. }
  3153. e.mapStart(len(v))
  3154. if e.h.Canonical {
  3155. v2 := make([]int64, len(v))
  3156. var i uint
  3157. for k := range v {
  3158. v2[i] = k
  3159. i++
  3160. }
  3161. sort.Sort(int64Slice(v2))
  3162. for _, k2 := range v2 {
  3163. e.mapElemKey()
  3164. e.e.EncodeInt(k2)
  3165. e.mapElemValue()
  3166. e.e.EncodeUint(uint64(v[k2]))
  3167. }
  3168. } else {
  3169. for k2, v2 := range v {
  3170. e.mapElemKey()
  3171. e.e.EncodeInt(k2)
  3172. e.mapElemValue()
  3173. e.e.EncodeUint(uint64(v2))
  3174. }
  3175. }
  3176. e.mapEnd()
  3177. }
  3178. func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  3179. fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e)
  3180. }
  3181. func (fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) {
  3182. if v == nil {
  3183. e.e.EncodeNil()
  3184. return
  3185. }
  3186. e.mapStart(len(v))
  3187. if e.h.Canonical {
  3188. v2 := make([]int64, len(v))
  3189. var i uint
  3190. for k := range v {
  3191. v2[i] = k
  3192. i++
  3193. }
  3194. sort.Sort(int64Slice(v2))
  3195. for _, k2 := range v2 {
  3196. e.mapElemKey()
  3197. e.e.EncodeInt(k2)
  3198. e.mapElemValue()
  3199. e.e.EncodeUint(v[k2])
  3200. }
  3201. } else {
  3202. for k2, v2 := range v {
  3203. e.mapElemKey()
  3204. e.e.EncodeInt(k2)
  3205. e.mapElemValue()
  3206. e.e.EncodeUint(v2)
  3207. }
  3208. }
  3209. e.mapEnd()
  3210. }
  3211. func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  3212. fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e)
  3213. }
  3214. func (fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) {
  3215. if v == nil {
  3216. e.e.EncodeNil()
  3217. return
  3218. }
  3219. e.mapStart(len(v))
  3220. if e.h.Canonical {
  3221. v2 := make([]int64, len(v))
  3222. var i uint
  3223. for k := range v {
  3224. v2[i] = k
  3225. i++
  3226. }
  3227. sort.Sort(int64Slice(v2))
  3228. for _, k2 := range v2 {
  3229. e.mapElemKey()
  3230. e.e.EncodeInt(k2)
  3231. e.mapElemValue()
  3232. e.e.EncodeInt(int64(v[k2]))
  3233. }
  3234. } else {
  3235. for k2, v2 := range v {
  3236. e.mapElemKey()
  3237. e.e.EncodeInt(k2)
  3238. e.mapElemValue()
  3239. e.e.EncodeInt(int64(v2))
  3240. }
  3241. }
  3242. e.mapEnd()
  3243. }
  3244. func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  3245. fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e)
  3246. }
  3247. func (fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) {
  3248. if v == nil {
  3249. e.e.EncodeNil()
  3250. return
  3251. }
  3252. e.mapStart(len(v))
  3253. if e.h.Canonical {
  3254. v2 := make([]int64, len(v))
  3255. var i uint
  3256. for k := range v {
  3257. v2[i] = k
  3258. i++
  3259. }
  3260. sort.Sort(int64Slice(v2))
  3261. for _, k2 := range v2 {
  3262. e.mapElemKey()
  3263. e.e.EncodeInt(k2)
  3264. e.mapElemValue()
  3265. e.e.EncodeInt(v[k2])
  3266. }
  3267. } else {
  3268. for k2, v2 := range v {
  3269. e.mapElemKey()
  3270. e.e.EncodeInt(k2)
  3271. e.mapElemValue()
  3272. e.e.EncodeInt(v2)
  3273. }
  3274. }
  3275. e.mapEnd()
  3276. }
  3277. func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  3278. fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e)
  3279. }
  3280. func (fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) {
  3281. if v == nil {
  3282. e.e.EncodeNil()
  3283. return
  3284. }
  3285. e.mapStart(len(v))
  3286. if e.h.Canonical {
  3287. v2 := make([]int64, len(v))
  3288. var i uint
  3289. for k := range v {
  3290. v2[i] = k
  3291. i++
  3292. }
  3293. sort.Sort(int64Slice(v2))
  3294. for _, k2 := range v2 {
  3295. e.mapElemKey()
  3296. e.e.EncodeInt(k2)
  3297. e.mapElemValue()
  3298. e.e.EncodeFloat32(v[k2])
  3299. }
  3300. } else {
  3301. for k2, v2 := range v {
  3302. e.mapElemKey()
  3303. e.e.EncodeInt(k2)
  3304. e.mapElemValue()
  3305. e.e.EncodeFloat32(v2)
  3306. }
  3307. }
  3308. e.mapEnd()
  3309. }
  3310. func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  3311. fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e)
  3312. }
  3313. func (fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) {
  3314. if v == nil {
  3315. e.e.EncodeNil()
  3316. return
  3317. }
  3318. e.mapStart(len(v))
  3319. if e.h.Canonical {
  3320. v2 := make([]int64, len(v))
  3321. var i uint
  3322. for k := range v {
  3323. v2[i] = k
  3324. i++
  3325. }
  3326. sort.Sort(int64Slice(v2))
  3327. for _, k2 := range v2 {
  3328. e.mapElemKey()
  3329. e.e.EncodeInt(k2)
  3330. e.mapElemValue()
  3331. e.e.EncodeFloat64(v[k2])
  3332. }
  3333. } else {
  3334. for k2, v2 := range v {
  3335. e.mapElemKey()
  3336. e.e.EncodeInt(k2)
  3337. e.mapElemValue()
  3338. e.e.EncodeFloat64(v2)
  3339. }
  3340. }
  3341. e.mapEnd()
  3342. }
  3343. func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  3344. fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e)
  3345. }
  3346. func (fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) {
  3347. if v == nil {
  3348. e.e.EncodeNil()
  3349. return
  3350. }
  3351. e.mapStart(len(v))
  3352. if e.h.Canonical {
  3353. v2 := make([]int64, len(v))
  3354. var i uint
  3355. for k := range v {
  3356. v2[i] = k
  3357. i++
  3358. }
  3359. sort.Sort(int64Slice(v2))
  3360. for _, k2 := range v2 {
  3361. e.mapElemKey()
  3362. e.e.EncodeInt(k2)
  3363. e.mapElemValue()
  3364. e.e.EncodeBool(v[k2])
  3365. }
  3366. } else {
  3367. for k2, v2 := range v {
  3368. e.mapElemKey()
  3369. e.e.EncodeInt(k2)
  3370. e.mapElemValue()
  3371. e.e.EncodeBool(v2)
  3372. }
  3373. }
  3374. e.mapEnd()
  3375. }
  3376. // -- decode
  3377. // -- -- fast path type switch
  3378. func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
  3379. var changed bool
  3380. switch v := iv.(type) {
  3381. case []interface{}:
  3382. var v2 []interface{}
  3383. v2, changed = fastpathTV.DecSliceIntfV(v, false, d)
  3384. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3385. copy(v, v2)
  3386. }
  3387. case *[]interface{}:
  3388. var v2 []interface{}
  3389. v2, changed = fastpathTV.DecSliceIntfV(*v, true, d)
  3390. if changed {
  3391. *v = v2
  3392. }
  3393. case []string:
  3394. var v2 []string
  3395. v2, changed = fastpathTV.DecSliceStringV(v, false, d)
  3396. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3397. copy(v, v2)
  3398. }
  3399. case *[]string:
  3400. var v2 []string
  3401. v2, changed = fastpathTV.DecSliceStringV(*v, true, d)
  3402. if changed {
  3403. *v = v2
  3404. }
  3405. case [][]byte:
  3406. var v2 [][]byte
  3407. v2, changed = fastpathTV.DecSliceBytesV(v, false, d)
  3408. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3409. copy(v, v2)
  3410. }
  3411. case *[][]byte:
  3412. var v2 [][]byte
  3413. v2, changed = fastpathTV.DecSliceBytesV(*v, true, d)
  3414. if changed {
  3415. *v = v2
  3416. }
  3417. case []float32:
  3418. var v2 []float32
  3419. v2, changed = fastpathTV.DecSliceFloat32V(v, false, d)
  3420. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3421. copy(v, v2)
  3422. }
  3423. case *[]float32:
  3424. var v2 []float32
  3425. v2, changed = fastpathTV.DecSliceFloat32V(*v, true, d)
  3426. if changed {
  3427. *v = v2
  3428. }
  3429. case []float64:
  3430. var v2 []float64
  3431. v2, changed = fastpathTV.DecSliceFloat64V(v, false, d)
  3432. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3433. copy(v, v2)
  3434. }
  3435. case *[]float64:
  3436. var v2 []float64
  3437. v2, changed = fastpathTV.DecSliceFloat64V(*v, true, d)
  3438. if changed {
  3439. *v = v2
  3440. }
  3441. case []uint:
  3442. var v2 []uint
  3443. v2, changed = fastpathTV.DecSliceUintV(v, false, d)
  3444. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3445. copy(v, v2)
  3446. }
  3447. case *[]uint:
  3448. var v2 []uint
  3449. v2, changed = fastpathTV.DecSliceUintV(*v, true, d)
  3450. if changed {
  3451. *v = v2
  3452. }
  3453. case []uint16:
  3454. var v2 []uint16
  3455. v2, changed = fastpathTV.DecSliceUint16V(v, false, d)
  3456. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3457. copy(v, v2)
  3458. }
  3459. case *[]uint16:
  3460. var v2 []uint16
  3461. v2, changed = fastpathTV.DecSliceUint16V(*v, true, d)
  3462. if changed {
  3463. *v = v2
  3464. }
  3465. case []uint32:
  3466. var v2 []uint32
  3467. v2, changed = fastpathTV.DecSliceUint32V(v, false, d)
  3468. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3469. copy(v, v2)
  3470. }
  3471. case *[]uint32:
  3472. var v2 []uint32
  3473. v2, changed = fastpathTV.DecSliceUint32V(*v, true, d)
  3474. if changed {
  3475. *v = v2
  3476. }
  3477. case []uint64:
  3478. var v2 []uint64
  3479. v2, changed = fastpathTV.DecSliceUint64V(v, false, d)
  3480. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3481. copy(v, v2)
  3482. }
  3483. case *[]uint64:
  3484. var v2 []uint64
  3485. v2, changed = fastpathTV.DecSliceUint64V(*v, true, d)
  3486. if changed {
  3487. *v = v2
  3488. }
  3489. case []int:
  3490. var v2 []int
  3491. v2, changed = fastpathTV.DecSliceIntV(v, false, d)
  3492. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3493. copy(v, v2)
  3494. }
  3495. case *[]int:
  3496. var v2 []int
  3497. v2, changed = fastpathTV.DecSliceIntV(*v, true, d)
  3498. if changed {
  3499. *v = v2
  3500. }
  3501. case []int8:
  3502. var v2 []int8
  3503. v2, changed = fastpathTV.DecSliceInt8V(v, false, d)
  3504. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3505. copy(v, v2)
  3506. }
  3507. case *[]int8:
  3508. var v2 []int8
  3509. v2, changed = fastpathTV.DecSliceInt8V(*v, true, d)
  3510. if changed {
  3511. *v = v2
  3512. }
  3513. case []int16:
  3514. var v2 []int16
  3515. v2, changed = fastpathTV.DecSliceInt16V(v, false, d)
  3516. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3517. copy(v, v2)
  3518. }
  3519. case *[]int16:
  3520. var v2 []int16
  3521. v2, changed = fastpathTV.DecSliceInt16V(*v, true, d)
  3522. if changed {
  3523. *v = v2
  3524. }
  3525. case []int32:
  3526. var v2 []int32
  3527. v2, changed = fastpathTV.DecSliceInt32V(v, false, d)
  3528. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3529. copy(v, v2)
  3530. }
  3531. case *[]int32:
  3532. var v2 []int32
  3533. v2, changed = fastpathTV.DecSliceInt32V(*v, true, d)
  3534. if changed {
  3535. *v = v2
  3536. }
  3537. case []int64:
  3538. var v2 []int64
  3539. v2, changed = fastpathTV.DecSliceInt64V(v, false, d)
  3540. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3541. copy(v, v2)
  3542. }
  3543. case *[]int64:
  3544. var v2 []int64
  3545. v2, changed = fastpathTV.DecSliceInt64V(*v, true, d)
  3546. if changed {
  3547. *v = v2
  3548. }
  3549. case []bool:
  3550. var v2 []bool
  3551. v2, changed = fastpathTV.DecSliceBoolV(v, false, d)
  3552. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  3553. copy(v, v2)
  3554. }
  3555. case *[]bool:
  3556. var v2 []bool
  3557. v2, changed = fastpathTV.DecSliceBoolV(*v, true, d)
  3558. if changed {
  3559. *v = v2
  3560. }
  3561. case map[string]interface{}:
  3562. fastpathTV.DecMapStringIntfV(v, false, d)
  3563. case *map[string]interface{}:
  3564. var v2 map[string]interface{}
  3565. v2, changed = fastpathTV.DecMapStringIntfV(*v, true, d)
  3566. if changed {
  3567. *v = v2
  3568. }
  3569. case map[string]string:
  3570. fastpathTV.DecMapStringStringV(v, false, d)
  3571. case *map[string]string:
  3572. var v2 map[string]string
  3573. v2, changed = fastpathTV.DecMapStringStringV(*v, true, d)
  3574. if changed {
  3575. *v = v2
  3576. }
  3577. case map[string][]byte:
  3578. fastpathTV.DecMapStringBytesV(v, false, d)
  3579. case *map[string][]byte:
  3580. var v2 map[string][]byte
  3581. v2, changed = fastpathTV.DecMapStringBytesV(*v, true, d)
  3582. if changed {
  3583. *v = v2
  3584. }
  3585. case map[string]uint:
  3586. fastpathTV.DecMapStringUintV(v, false, d)
  3587. case *map[string]uint:
  3588. var v2 map[string]uint
  3589. v2, changed = fastpathTV.DecMapStringUintV(*v, true, d)
  3590. if changed {
  3591. *v = v2
  3592. }
  3593. case map[string]uint8:
  3594. fastpathTV.DecMapStringUint8V(v, false, d)
  3595. case *map[string]uint8:
  3596. var v2 map[string]uint8
  3597. v2, changed = fastpathTV.DecMapStringUint8V(*v, true, d)
  3598. if changed {
  3599. *v = v2
  3600. }
  3601. case map[string]uint64:
  3602. fastpathTV.DecMapStringUint64V(v, false, d)
  3603. case *map[string]uint64:
  3604. var v2 map[string]uint64
  3605. v2, changed = fastpathTV.DecMapStringUint64V(*v, true, d)
  3606. if changed {
  3607. *v = v2
  3608. }
  3609. case map[string]int:
  3610. fastpathTV.DecMapStringIntV(v, false, d)
  3611. case *map[string]int:
  3612. var v2 map[string]int
  3613. v2, changed = fastpathTV.DecMapStringIntV(*v, true, d)
  3614. if changed {
  3615. *v = v2
  3616. }
  3617. case map[string]int64:
  3618. fastpathTV.DecMapStringInt64V(v, false, d)
  3619. case *map[string]int64:
  3620. var v2 map[string]int64
  3621. v2, changed = fastpathTV.DecMapStringInt64V(*v, true, d)
  3622. if changed {
  3623. *v = v2
  3624. }
  3625. case map[string]float32:
  3626. fastpathTV.DecMapStringFloat32V(v, false, d)
  3627. case *map[string]float32:
  3628. var v2 map[string]float32
  3629. v2, changed = fastpathTV.DecMapStringFloat32V(*v, true, d)
  3630. if changed {
  3631. *v = v2
  3632. }
  3633. case map[string]float64:
  3634. fastpathTV.DecMapStringFloat64V(v, false, d)
  3635. case *map[string]float64:
  3636. var v2 map[string]float64
  3637. v2, changed = fastpathTV.DecMapStringFloat64V(*v, true, d)
  3638. if changed {
  3639. *v = v2
  3640. }
  3641. case map[string]bool:
  3642. fastpathTV.DecMapStringBoolV(v, false, d)
  3643. case *map[string]bool:
  3644. var v2 map[string]bool
  3645. v2, changed = fastpathTV.DecMapStringBoolV(*v, true, d)
  3646. if changed {
  3647. *v = v2
  3648. }
  3649. case map[uint]interface{}:
  3650. fastpathTV.DecMapUintIntfV(v, false, d)
  3651. case *map[uint]interface{}:
  3652. var v2 map[uint]interface{}
  3653. v2, changed = fastpathTV.DecMapUintIntfV(*v, true, d)
  3654. if changed {
  3655. *v = v2
  3656. }
  3657. case map[uint]string:
  3658. fastpathTV.DecMapUintStringV(v, false, d)
  3659. case *map[uint]string:
  3660. var v2 map[uint]string
  3661. v2, changed = fastpathTV.DecMapUintStringV(*v, true, d)
  3662. if changed {
  3663. *v = v2
  3664. }
  3665. case map[uint][]byte:
  3666. fastpathTV.DecMapUintBytesV(v, false, d)
  3667. case *map[uint][]byte:
  3668. var v2 map[uint][]byte
  3669. v2, changed = fastpathTV.DecMapUintBytesV(*v, true, d)
  3670. if changed {
  3671. *v = v2
  3672. }
  3673. case map[uint]uint:
  3674. fastpathTV.DecMapUintUintV(v, false, d)
  3675. case *map[uint]uint:
  3676. var v2 map[uint]uint
  3677. v2, changed = fastpathTV.DecMapUintUintV(*v, true, d)
  3678. if changed {
  3679. *v = v2
  3680. }
  3681. case map[uint]uint8:
  3682. fastpathTV.DecMapUintUint8V(v, false, d)
  3683. case *map[uint]uint8:
  3684. var v2 map[uint]uint8
  3685. v2, changed = fastpathTV.DecMapUintUint8V(*v, true, d)
  3686. if changed {
  3687. *v = v2
  3688. }
  3689. case map[uint]uint64:
  3690. fastpathTV.DecMapUintUint64V(v, false, d)
  3691. case *map[uint]uint64:
  3692. var v2 map[uint]uint64
  3693. v2, changed = fastpathTV.DecMapUintUint64V(*v, true, d)
  3694. if changed {
  3695. *v = v2
  3696. }
  3697. case map[uint]int:
  3698. fastpathTV.DecMapUintIntV(v, false, d)
  3699. case *map[uint]int:
  3700. var v2 map[uint]int
  3701. v2, changed = fastpathTV.DecMapUintIntV(*v, true, d)
  3702. if changed {
  3703. *v = v2
  3704. }
  3705. case map[uint]int64:
  3706. fastpathTV.DecMapUintInt64V(v, false, d)
  3707. case *map[uint]int64:
  3708. var v2 map[uint]int64
  3709. v2, changed = fastpathTV.DecMapUintInt64V(*v, true, d)
  3710. if changed {
  3711. *v = v2
  3712. }
  3713. case map[uint]float32:
  3714. fastpathTV.DecMapUintFloat32V(v, false, d)
  3715. case *map[uint]float32:
  3716. var v2 map[uint]float32
  3717. v2, changed = fastpathTV.DecMapUintFloat32V(*v, true, d)
  3718. if changed {
  3719. *v = v2
  3720. }
  3721. case map[uint]float64:
  3722. fastpathTV.DecMapUintFloat64V(v, false, d)
  3723. case *map[uint]float64:
  3724. var v2 map[uint]float64
  3725. v2, changed = fastpathTV.DecMapUintFloat64V(*v, true, d)
  3726. if changed {
  3727. *v = v2
  3728. }
  3729. case map[uint]bool:
  3730. fastpathTV.DecMapUintBoolV(v, false, d)
  3731. case *map[uint]bool:
  3732. var v2 map[uint]bool
  3733. v2, changed = fastpathTV.DecMapUintBoolV(*v, true, d)
  3734. if changed {
  3735. *v = v2
  3736. }
  3737. case map[uint8]interface{}:
  3738. fastpathTV.DecMapUint8IntfV(v, false, d)
  3739. case *map[uint8]interface{}:
  3740. var v2 map[uint8]interface{}
  3741. v2, changed = fastpathTV.DecMapUint8IntfV(*v, true, d)
  3742. if changed {
  3743. *v = v2
  3744. }
  3745. case map[uint8]string:
  3746. fastpathTV.DecMapUint8StringV(v, false, d)
  3747. case *map[uint8]string:
  3748. var v2 map[uint8]string
  3749. v2, changed = fastpathTV.DecMapUint8StringV(*v, true, d)
  3750. if changed {
  3751. *v = v2
  3752. }
  3753. case map[uint8][]byte:
  3754. fastpathTV.DecMapUint8BytesV(v, false, d)
  3755. case *map[uint8][]byte:
  3756. var v2 map[uint8][]byte
  3757. v2, changed = fastpathTV.DecMapUint8BytesV(*v, true, d)
  3758. if changed {
  3759. *v = v2
  3760. }
  3761. case map[uint8]uint:
  3762. fastpathTV.DecMapUint8UintV(v, false, d)
  3763. case *map[uint8]uint:
  3764. var v2 map[uint8]uint
  3765. v2, changed = fastpathTV.DecMapUint8UintV(*v, true, d)
  3766. if changed {
  3767. *v = v2
  3768. }
  3769. case map[uint8]uint8:
  3770. fastpathTV.DecMapUint8Uint8V(v, false, d)
  3771. case *map[uint8]uint8:
  3772. var v2 map[uint8]uint8
  3773. v2, changed = fastpathTV.DecMapUint8Uint8V(*v, true, d)
  3774. if changed {
  3775. *v = v2
  3776. }
  3777. case map[uint8]uint64:
  3778. fastpathTV.DecMapUint8Uint64V(v, false, d)
  3779. case *map[uint8]uint64:
  3780. var v2 map[uint8]uint64
  3781. v2, changed = fastpathTV.DecMapUint8Uint64V(*v, true, d)
  3782. if changed {
  3783. *v = v2
  3784. }
  3785. case map[uint8]int:
  3786. fastpathTV.DecMapUint8IntV(v, false, d)
  3787. case *map[uint8]int:
  3788. var v2 map[uint8]int
  3789. v2, changed = fastpathTV.DecMapUint8IntV(*v, true, d)
  3790. if changed {
  3791. *v = v2
  3792. }
  3793. case map[uint8]int64:
  3794. fastpathTV.DecMapUint8Int64V(v, false, d)
  3795. case *map[uint8]int64:
  3796. var v2 map[uint8]int64
  3797. v2, changed = fastpathTV.DecMapUint8Int64V(*v, true, d)
  3798. if changed {
  3799. *v = v2
  3800. }
  3801. case map[uint8]float32:
  3802. fastpathTV.DecMapUint8Float32V(v, false, d)
  3803. case *map[uint8]float32:
  3804. var v2 map[uint8]float32
  3805. v2, changed = fastpathTV.DecMapUint8Float32V(*v, true, d)
  3806. if changed {
  3807. *v = v2
  3808. }
  3809. case map[uint8]float64:
  3810. fastpathTV.DecMapUint8Float64V(v, false, d)
  3811. case *map[uint8]float64:
  3812. var v2 map[uint8]float64
  3813. v2, changed = fastpathTV.DecMapUint8Float64V(*v, true, d)
  3814. if changed {
  3815. *v = v2
  3816. }
  3817. case map[uint8]bool:
  3818. fastpathTV.DecMapUint8BoolV(v, false, d)
  3819. case *map[uint8]bool:
  3820. var v2 map[uint8]bool
  3821. v2, changed = fastpathTV.DecMapUint8BoolV(*v, true, d)
  3822. if changed {
  3823. *v = v2
  3824. }
  3825. case map[uint64]interface{}:
  3826. fastpathTV.DecMapUint64IntfV(v, false, d)
  3827. case *map[uint64]interface{}:
  3828. var v2 map[uint64]interface{}
  3829. v2, changed = fastpathTV.DecMapUint64IntfV(*v, true, d)
  3830. if changed {
  3831. *v = v2
  3832. }
  3833. case map[uint64]string:
  3834. fastpathTV.DecMapUint64StringV(v, false, d)
  3835. case *map[uint64]string:
  3836. var v2 map[uint64]string
  3837. v2, changed = fastpathTV.DecMapUint64StringV(*v, true, d)
  3838. if changed {
  3839. *v = v2
  3840. }
  3841. case map[uint64][]byte:
  3842. fastpathTV.DecMapUint64BytesV(v, false, d)
  3843. case *map[uint64][]byte:
  3844. var v2 map[uint64][]byte
  3845. v2, changed = fastpathTV.DecMapUint64BytesV(*v, true, d)
  3846. if changed {
  3847. *v = v2
  3848. }
  3849. case map[uint64]uint:
  3850. fastpathTV.DecMapUint64UintV(v, false, d)
  3851. case *map[uint64]uint:
  3852. var v2 map[uint64]uint
  3853. v2, changed = fastpathTV.DecMapUint64UintV(*v, true, d)
  3854. if changed {
  3855. *v = v2
  3856. }
  3857. case map[uint64]uint8:
  3858. fastpathTV.DecMapUint64Uint8V(v, false, d)
  3859. case *map[uint64]uint8:
  3860. var v2 map[uint64]uint8
  3861. v2, changed = fastpathTV.DecMapUint64Uint8V(*v, true, d)
  3862. if changed {
  3863. *v = v2
  3864. }
  3865. case map[uint64]uint64:
  3866. fastpathTV.DecMapUint64Uint64V(v, false, d)
  3867. case *map[uint64]uint64:
  3868. var v2 map[uint64]uint64
  3869. v2, changed = fastpathTV.DecMapUint64Uint64V(*v, true, d)
  3870. if changed {
  3871. *v = v2
  3872. }
  3873. case map[uint64]int:
  3874. fastpathTV.DecMapUint64IntV(v, false, d)
  3875. case *map[uint64]int:
  3876. var v2 map[uint64]int
  3877. v2, changed = fastpathTV.DecMapUint64IntV(*v, true, d)
  3878. if changed {
  3879. *v = v2
  3880. }
  3881. case map[uint64]int64:
  3882. fastpathTV.DecMapUint64Int64V(v, false, d)
  3883. case *map[uint64]int64:
  3884. var v2 map[uint64]int64
  3885. v2, changed = fastpathTV.DecMapUint64Int64V(*v, true, d)
  3886. if changed {
  3887. *v = v2
  3888. }
  3889. case map[uint64]float32:
  3890. fastpathTV.DecMapUint64Float32V(v, false, d)
  3891. case *map[uint64]float32:
  3892. var v2 map[uint64]float32
  3893. v2, changed = fastpathTV.DecMapUint64Float32V(*v, true, d)
  3894. if changed {
  3895. *v = v2
  3896. }
  3897. case map[uint64]float64:
  3898. fastpathTV.DecMapUint64Float64V(v, false, d)
  3899. case *map[uint64]float64:
  3900. var v2 map[uint64]float64
  3901. v2, changed = fastpathTV.DecMapUint64Float64V(*v, true, d)
  3902. if changed {
  3903. *v = v2
  3904. }
  3905. case map[uint64]bool:
  3906. fastpathTV.DecMapUint64BoolV(v, false, d)
  3907. case *map[uint64]bool:
  3908. var v2 map[uint64]bool
  3909. v2, changed = fastpathTV.DecMapUint64BoolV(*v, true, d)
  3910. if changed {
  3911. *v = v2
  3912. }
  3913. case map[int]interface{}:
  3914. fastpathTV.DecMapIntIntfV(v, false, d)
  3915. case *map[int]interface{}:
  3916. var v2 map[int]interface{}
  3917. v2, changed = fastpathTV.DecMapIntIntfV(*v, true, d)
  3918. if changed {
  3919. *v = v2
  3920. }
  3921. case map[int]string:
  3922. fastpathTV.DecMapIntStringV(v, false, d)
  3923. case *map[int]string:
  3924. var v2 map[int]string
  3925. v2, changed = fastpathTV.DecMapIntStringV(*v, true, d)
  3926. if changed {
  3927. *v = v2
  3928. }
  3929. case map[int][]byte:
  3930. fastpathTV.DecMapIntBytesV(v, false, d)
  3931. case *map[int][]byte:
  3932. var v2 map[int][]byte
  3933. v2, changed = fastpathTV.DecMapIntBytesV(*v, true, d)
  3934. if changed {
  3935. *v = v2
  3936. }
  3937. case map[int]uint:
  3938. fastpathTV.DecMapIntUintV(v, false, d)
  3939. case *map[int]uint:
  3940. var v2 map[int]uint
  3941. v2, changed = fastpathTV.DecMapIntUintV(*v, true, d)
  3942. if changed {
  3943. *v = v2
  3944. }
  3945. case map[int]uint8:
  3946. fastpathTV.DecMapIntUint8V(v, false, d)
  3947. case *map[int]uint8:
  3948. var v2 map[int]uint8
  3949. v2, changed = fastpathTV.DecMapIntUint8V(*v, true, d)
  3950. if changed {
  3951. *v = v2
  3952. }
  3953. case map[int]uint64:
  3954. fastpathTV.DecMapIntUint64V(v, false, d)
  3955. case *map[int]uint64:
  3956. var v2 map[int]uint64
  3957. v2, changed = fastpathTV.DecMapIntUint64V(*v, true, d)
  3958. if changed {
  3959. *v = v2
  3960. }
  3961. case map[int]int:
  3962. fastpathTV.DecMapIntIntV(v, false, d)
  3963. case *map[int]int:
  3964. var v2 map[int]int
  3965. v2, changed = fastpathTV.DecMapIntIntV(*v, true, d)
  3966. if changed {
  3967. *v = v2
  3968. }
  3969. case map[int]int64:
  3970. fastpathTV.DecMapIntInt64V(v, false, d)
  3971. case *map[int]int64:
  3972. var v2 map[int]int64
  3973. v2, changed = fastpathTV.DecMapIntInt64V(*v, true, d)
  3974. if changed {
  3975. *v = v2
  3976. }
  3977. case map[int]float32:
  3978. fastpathTV.DecMapIntFloat32V(v, false, d)
  3979. case *map[int]float32:
  3980. var v2 map[int]float32
  3981. v2, changed = fastpathTV.DecMapIntFloat32V(*v, true, d)
  3982. if changed {
  3983. *v = v2
  3984. }
  3985. case map[int]float64:
  3986. fastpathTV.DecMapIntFloat64V(v, false, d)
  3987. case *map[int]float64:
  3988. var v2 map[int]float64
  3989. v2, changed = fastpathTV.DecMapIntFloat64V(*v, true, d)
  3990. if changed {
  3991. *v = v2
  3992. }
  3993. case map[int]bool:
  3994. fastpathTV.DecMapIntBoolV(v, false, d)
  3995. case *map[int]bool:
  3996. var v2 map[int]bool
  3997. v2, changed = fastpathTV.DecMapIntBoolV(*v, true, d)
  3998. if changed {
  3999. *v = v2
  4000. }
  4001. case map[int64]interface{}:
  4002. fastpathTV.DecMapInt64IntfV(v, false, d)
  4003. case *map[int64]interface{}:
  4004. var v2 map[int64]interface{}
  4005. v2, changed = fastpathTV.DecMapInt64IntfV(*v, true, d)
  4006. if changed {
  4007. *v = v2
  4008. }
  4009. case map[int64]string:
  4010. fastpathTV.DecMapInt64StringV(v, false, d)
  4011. case *map[int64]string:
  4012. var v2 map[int64]string
  4013. v2, changed = fastpathTV.DecMapInt64StringV(*v, true, d)
  4014. if changed {
  4015. *v = v2
  4016. }
  4017. case map[int64][]byte:
  4018. fastpathTV.DecMapInt64BytesV(v, false, d)
  4019. case *map[int64][]byte:
  4020. var v2 map[int64][]byte
  4021. v2, changed = fastpathTV.DecMapInt64BytesV(*v, true, d)
  4022. if changed {
  4023. *v = v2
  4024. }
  4025. case map[int64]uint:
  4026. fastpathTV.DecMapInt64UintV(v, false, d)
  4027. case *map[int64]uint:
  4028. var v2 map[int64]uint
  4029. v2, changed = fastpathTV.DecMapInt64UintV(*v, true, d)
  4030. if changed {
  4031. *v = v2
  4032. }
  4033. case map[int64]uint8:
  4034. fastpathTV.DecMapInt64Uint8V(v, false, d)
  4035. case *map[int64]uint8:
  4036. var v2 map[int64]uint8
  4037. v2, changed = fastpathTV.DecMapInt64Uint8V(*v, true, d)
  4038. if changed {
  4039. *v = v2
  4040. }
  4041. case map[int64]uint64:
  4042. fastpathTV.DecMapInt64Uint64V(v, false, d)
  4043. case *map[int64]uint64:
  4044. var v2 map[int64]uint64
  4045. v2, changed = fastpathTV.DecMapInt64Uint64V(*v, true, d)
  4046. if changed {
  4047. *v = v2
  4048. }
  4049. case map[int64]int:
  4050. fastpathTV.DecMapInt64IntV(v, false, d)
  4051. case *map[int64]int:
  4052. var v2 map[int64]int
  4053. v2, changed = fastpathTV.DecMapInt64IntV(*v, true, d)
  4054. if changed {
  4055. *v = v2
  4056. }
  4057. case map[int64]int64:
  4058. fastpathTV.DecMapInt64Int64V(v, false, d)
  4059. case *map[int64]int64:
  4060. var v2 map[int64]int64
  4061. v2, changed = fastpathTV.DecMapInt64Int64V(*v, true, d)
  4062. if changed {
  4063. *v = v2
  4064. }
  4065. case map[int64]float32:
  4066. fastpathTV.DecMapInt64Float32V(v, false, d)
  4067. case *map[int64]float32:
  4068. var v2 map[int64]float32
  4069. v2, changed = fastpathTV.DecMapInt64Float32V(*v, true, d)
  4070. if changed {
  4071. *v = v2
  4072. }
  4073. case map[int64]float64:
  4074. fastpathTV.DecMapInt64Float64V(v, false, d)
  4075. case *map[int64]float64:
  4076. var v2 map[int64]float64
  4077. v2, changed = fastpathTV.DecMapInt64Float64V(*v, true, d)
  4078. if changed {
  4079. *v = v2
  4080. }
  4081. case map[int64]bool:
  4082. fastpathTV.DecMapInt64BoolV(v, false, d)
  4083. case *map[int64]bool:
  4084. var v2 map[int64]bool
  4085. v2, changed = fastpathTV.DecMapInt64BoolV(*v, true, d)
  4086. if changed {
  4087. *v = v2
  4088. }
  4089. default:
  4090. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  4091. return false
  4092. }
  4093. return true
  4094. }
  4095. func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
  4096. switch v := iv.(type) {
  4097. case *[]interface{}:
  4098. *v = nil
  4099. case *[]string:
  4100. *v = nil
  4101. case *[][]byte:
  4102. *v = nil
  4103. case *[]float32:
  4104. *v = nil
  4105. case *[]float64:
  4106. *v = nil
  4107. case *[]uint:
  4108. *v = nil
  4109. case *[]uint16:
  4110. *v = nil
  4111. case *[]uint32:
  4112. *v = nil
  4113. case *[]uint64:
  4114. *v = nil
  4115. case *[]int:
  4116. *v = nil
  4117. case *[]int8:
  4118. *v = nil
  4119. case *[]int16:
  4120. *v = nil
  4121. case *[]int32:
  4122. *v = nil
  4123. case *[]int64:
  4124. *v = nil
  4125. case *[]bool:
  4126. *v = nil
  4127. case *map[string]interface{}:
  4128. *v = nil
  4129. case *map[string]string:
  4130. *v = nil
  4131. case *map[string][]byte:
  4132. *v = nil
  4133. case *map[string]uint:
  4134. *v = nil
  4135. case *map[string]uint8:
  4136. *v = nil
  4137. case *map[string]uint64:
  4138. *v = nil
  4139. case *map[string]int:
  4140. *v = nil
  4141. case *map[string]int64:
  4142. *v = nil
  4143. case *map[string]float32:
  4144. *v = nil
  4145. case *map[string]float64:
  4146. *v = nil
  4147. case *map[string]bool:
  4148. *v = nil
  4149. case *map[uint]interface{}:
  4150. *v = nil
  4151. case *map[uint]string:
  4152. *v = nil
  4153. case *map[uint][]byte:
  4154. *v = nil
  4155. case *map[uint]uint:
  4156. *v = nil
  4157. case *map[uint]uint8:
  4158. *v = nil
  4159. case *map[uint]uint64:
  4160. *v = nil
  4161. case *map[uint]int:
  4162. *v = nil
  4163. case *map[uint]int64:
  4164. *v = nil
  4165. case *map[uint]float32:
  4166. *v = nil
  4167. case *map[uint]float64:
  4168. *v = nil
  4169. case *map[uint]bool:
  4170. *v = nil
  4171. case *map[uint8]interface{}:
  4172. *v = nil
  4173. case *map[uint8]string:
  4174. *v = nil
  4175. case *map[uint8][]byte:
  4176. *v = nil
  4177. case *map[uint8]uint:
  4178. *v = nil
  4179. case *map[uint8]uint8:
  4180. *v = nil
  4181. case *map[uint8]uint64:
  4182. *v = nil
  4183. case *map[uint8]int:
  4184. *v = nil
  4185. case *map[uint8]int64:
  4186. *v = nil
  4187. case *map[uint8]float32:
  4188. *v = nil
  4189. case *map[uint8]float64:
  4190. *v = nil
  4191. case *map[uint8]bool:
  4192. *v = nil
  4193. case *map[uint64]interface{}:
  4194. *v = nil
  4195. case *map[uint64]string:
  4196. *v = nil
  4197. case *map[uint64][]byte:
  4198. *v = nil
  4199. case *map[uint64]uint:
  4200. *v = nil
  4201. case *map[uint64]uint8:
  4202. *v = nil
  4203. case *map[uint64]uint64:
  4204. *v = nil
  4205. case *map[uint64]int:
  4206. *v = nil
  4207. case *map[uint64]int64:
  4208. *v = nil
  4209. case *map[uint64]float32:
  4210. *v = nil
  4211. case *map[uint64]float64:
  4212. *v = nil
  4213. case *map[uint64]bool:
  4214. *v = nil
  4215. case *map[int]interface{}:
  4216. *v = nil
  4217. case *map[int]string:
  4218. *v = nil
  4219. case *map[int][]byte:
  4220. *v = nil
  4221. case *map[int]uint:
  4222. *v = nil
  4223. case *map[int]uint8:
  4224. *v = nil
  4225. case *map[int]uint64:
  4226. *v = nil
  4227. case *map[int]int:
  4228. *v = nil
  4229. case *map[int]int64:
  4230. *v = nil
  4231. case *map[int]float32:
  4232. *v = nil
  4233. case *map[int]float64:
  4234. *v = nil
  4235. case *map[int]bool:
  4236. *v = nil
  4237. case *map[int64]interface{}:
  4238. *v = nil
  4239. case *map[int64]string:
  4240. *v = nil
  4241. case *map[int64][]byte:
  4242. *v = nil
  4243. case *map[int64]uint:
  4244. *v = nil
  4245. case *map[int64]uint8:
  4246. *v = nil
  4247. case *map[int64]uint64:
  4248. *v = nil
  4249. case *map[int64]int:
  4250. *v = nil
  4251. case *map[int64]int64:
  4252. *v = nil
  4253. case *map[int64]float32:
  4254. *v = nil
  4255. case *map[int64]float64:
  4256. *v = nil
  4257. case *map[int64]bool:
  4258. *v = nil
  4259. default:
  4260. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  4261. return false
  4262. }
  4263. return true
  4264. }
  4265. // -- -- fast path functions
  4266. func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  4267. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4268. vp := rv2i(rv).(*[]interface{})
  4269. if v, changed := fastpathTV.DecSliceIntfV(*vp, !array, d); changed {
  4270. *vp = v
  4271. }
  4272. } else {
  4273. v := rv2i(rv).([]interface{})
  4274. v2, changed := fastpathTV.DecSliceIntfV(v, !array, d)
  4275. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4276. copy(v, v2)
  4277. }
  4278. }
  4279. }
  4280. func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) {
  4281. if v, changed := f.DecSliceIntfV(*vp, true, d); changed {
  4282. *vp = v
  4283. }
  4284. }
  4285. func (fastpathT) DecSliceIntfV(v []interface{}, canChange bool, d *Decoder) (_ []interface{}, changed bool) {
  4286. slh, containerLenS := d.decSliceHelperStart()
  4287. if containerLenS == 0 {
  4288. if canChange {
  4289. if v == nil {
  4290. v = []interface{}{}
  4291. } else if len(v) != 0 {
  4292. v = v[:0]
  4293. }
  4294. changed = true
  4295. }
  4296. slh.End()
  4297. return v, changed
  4298. }
  4299. hasLen := containerLenS > 0
  4300. var xlen int
  4301. if hasLen && canChange {
  4302. if containerLenS > cap(v) {
  4303. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4304. if xlen <= cap(v) {
  4305. v = v[:uint(xlen)]
  4306. } else {
  4307. v = make([]interface{}, uint(xlen))
  4308. }
  4309. changed = true
  4310. } else if containerLenS != len(v) {
  4311. v = v[:containerLenS]
  4312. changed = true
  4313. }
  4314. }
  4315. var j int
  4316. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4317. if j == 0 && len(v) == 0 && canChange {
  4318. if hasLen {
  4319. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4320. } else {
  4321. xlen = 8
  4322. }
  4323. v = make([]interface{}, uint(xlen))
  4324. changed = true
  4325. }
  4326. var decodeIntoBlank bool
  4327. if j >= len(v) {
  4328. if canChange {
  4329. v = append(v, nil)
  4330. changed = true
  4331. } else {
  4332. d.arrayCannotExpand(len(v), j+1)
  4333. decodeIntoBlank = true
  4334. }
  4335. }
  4336. slh.ElemContainerState(j)
  4337. if decodeIntoBlank {
  4338. d.swallow()
  4339. } else if d.d.TryDecodeAsNil() {
  4340. v[uint(j)] = nil
  4341. } else {
  4342. d.decode(&v[uint(j)])
  4343. }
  4344. }
  4345. if canChange {
  4346. if j < len(v) {
  4347. v = v[:uint(j)]
  4348. changed = true
  4349. } else if j == 0 && v == nil {
  4350. v = make([]interface{}, 0)
  4351. changed = true
  4352. }
  4353. }
  4354. slh.End()
  4355. return v, changed
  4356. }
  4357. func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) {
  4358. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4359. vp := rv2i(rv).(*[]string)
  4360. if v, changed := fastpathTV.DecSliceStringV(*vp, !array, d); changed {
  4361. *vp = v
  4362. }
  4363. } else {
  4364. v := rv2i(rv).([]string)
  4365. v2, changed := fastpathTV.DecSliceStringV(v, !array, d)
  4366. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4367. copy(v, v2)
  4368. }
  4369. }
  4370. }
  4371. func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) {
  4372. if v, changed := f.DecSliceStringV(*vp, true, d); changed {
  4373. *vp = v
  4374. }
  4375. }
  4376. func (fastpathT) DecSliceStringV(v []string, canChange bool, d *Decoder) (_ []string, changed bool) {
  4377. slh, containerLenS := d.decSliceHelperStart()
  4378. if containerLenS == 0 {
  4379. if canChange {
  4380. if v == nil {
  4381. v = []string{}
  4382. } else if len(v) != 0 {
  4383. v = v[:0]
  4384. }
  4385. changed = true
  4386. }
  4387. slh.End()
  4388. return v, changed
  4389. }
  4390. hasLen := containerLenS > 0
  4391. var xlen int
  4392. if hasLen && canChange {
  4393. if containerLenS > cap(v) {
  4394. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4395. if xlen <= cap(v) {
  4396. v = v[:uint(xlen)]
  4397. } else {
  4398. v = make([]string, uint(xlen))
  4399. }
  4400. changed = true
  4401. } else if containerLenS != len(v) {
  4402. v = v[:containerLenS]
  4403. changed = true
  4404. }
  4405. }
  4406. var j int
  4407. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4408. if j == 0 && len(v) == 0 && canChange {
  4409. if hasLen {
  4410. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4411. } else {
  4412. xlen = 8
  4413. }
  4414. v = make([]string, uint(xlen))
  4415. changed = true
  4416. }
  4417. var decodeIntoBlank bool
  4418. if j >= len(v) {
  4419. if canChange {
  4420. v = append(v, "")
  4421. changed = true
  4422. } else {
  4423. d.arrayCannotExpand(len(v), j+1)
  4424. decodeIntoBlank = true
  4425. }
  4426. }
  4427. slh.ElemContainerState(j)
  4428. if decodeIntoBlank {
  4429. d.swallow()
  4430. } else if d.d.TryDecodeAsNil() {
  4431. v[uint(j)] = ""
  4432. } else {
  4433. v[uint(j)] = d.d.DecodeString()
  4434. }
  4435. }
  4436. if canChange {
  4437. if j < len(v) {
  4438. v = v[:uint(j)]
  4439. changed = true
  4440. } else if j == 0 && v == nil {
  4441. v = make([]string, 0)
  4442. changed = true
  4443. }
  4444. }
  4445. slh.End()
  4446. return v, changed
  4447. }
  4448. func (d *Decoder) fastpathDecSliceBytesR(f *codecFnInfo, rv reflect.Value) {
  4449. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4450. vp := rv2i(rv).(*[][]byte)
  4451. if v, changed := fastpathTV.DecSliceBytesV(*vp, !array, d); changed {
  4452. *vp = v
  4453. }
  4454. } else {
  4455. v := rv2i(rv).([][]byte)
  4456. v2, changed := fastpathTV.DecSliceBytesV(v, !array, d)
  4457. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4458. copy(v, v2)
  4459. }
  4460. }
  4461. }
  4462. func (f fastpathT) DecSliceBytesX(vp *[][]byte, d *Decoder) {
  4463. if v, changed := f.DecSliceBytesV(*vp, true, d); changed {
  4464. *vp = v
  4465. }
  4466. }
  4467. func (fastpathT) DecSliceBytesV(v [][]byte, canChange bool, d *Decoder) (_ [][]byte, changed bool) {
  4468. slh, containerLenS := d.decSliceHelperStart()
  4469. if containerLenS == 0 {
  4470. if canChange {
  4471. if v == nil {
  4472. v = [][]byte{}
  4473. } else if len(v) != 0 {
  4474. v = v[:0]
  4475. }
  4476. changed = true
  4477. }
  4478. slh.End()
  4479. return v, changed
  4480. }
  4481. hasLen := containerLenS > 0
  4482. var xlen int
  4483. if hasLen && canChange {
  4484. if containerLenS > cap(v) {
  4485. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
  4486. if xlen <= cap(v) {
  4487. v = v[:uint(xlen)]
  4488. } else {
  4489. v = make([][]byte, uint(xlen))
  4490. }
  4491. changed = true
  4492. } else if containerLenS != len(v) {
  4493. v = v[:containerLenS]
  4494. changed = true
  4495. }
  4496. }
  4497. var j int
  4498. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4499. if j == 0 && len(v) == 0 && canChange {
  4500. if hasLen {
  4501. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
  4502. } else {
  4503. xlen = 8
  4504. }
  4505. v = make([][]byte, uint(xlen))
  4506. changed = true
  4507. }
  4508. var decodeIntoBlank bool
  4509. if j >= len(v) {
  4510. if canChange {
  4511. v = append(v, nil)
  4512. changed = true
  4513. } else {
  4514. d.arrayCannotExpand(len(v), j+1)
  4515. decodeIntoBlank = true
  4516. }
  4517. }
  4518. slh.ElemContainerState(j)
  4519. if decodeIntoBlank {
  4520. d.swallow()
  4521. } else if d.d.TryDecodeAsNil() {
  4522. v[uint(j)] = nil
  4523. } else {
  4524. v[uint(j)] = d.d.DecodeBytes(nil, false)
  4525. }
  4526. }
  4527. if canChange {
  4528. if j < len(v) {
  4529. v = v[:uint(j)]
  4530. changed = true
  4531. } else if j == 0 && v == nil {
  4532. v = make([][]byte, 0)
  4533. changed = true
  4534. }
  4535. }
  4536. slh.End()
  4537. return v, changed
  4538. }
  4539. func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  4540. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4541. vp := rv2i(rv).(*[]float32)
  4542. if v, changed := fastpathTV.DecSliceFloat32V(*vp, !array, d); changed {
  4543. *vp = v
  4544. }
  4545. } else {
  4546. v := rv2i(rv).([]float32)
  4547. v2, changed := fastpathTV.DecSliceFloat32V(v, !array, d)
  4548. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4549. copy(v, v2)
  4550. }
  4551. }
  4552. }
  4553. func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) {
  4554. if v, changed := f.DecSliceFloat32V(*vp, true, d); changed {
  4555. *vp = v
  4556. }
  4557. }
  4558. func (fastpathT) DecSliceFloat32V(v []float32, canChange bool, d *Decoder) (_ []float32, changed bool) {
  4559. slh, containerLenS := d.decSliceHelperStart()
  4560. if containerLenS == 0 {
  4561. if canChange {
  4562. if v == nil {
  4563. v = []float32{}
  4564. } else if len(v) != 0 {
  4565. v = v[:0]
  4566. }
  4567. changed = true
  4568. }
  4569. slh.End()
  4570. return v, changed
  4571. }
  4572. hasLen := containerLenS > 0
  4573. var xlen int
  4574. if hasLen && canChange {
  4575. if containerLenS > cap(v) {
  4576. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4577. if xlen <= cap(v) {
  4578. v = v[:uint(xlen)]
  4579. } else {
  4580. v = make([]float32, uint(xlen))
  4581. }
  4582. changed = true
  4583. } else if containerLenS != len(v) {
  4584. v = v[:containerLenS]
  4585. changed = true
  4586. }
  4587. }
  4588. var j int
  4589. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4590. if j == 0 && len(v) == 0 && canChange {
  4591. if hasLen {
  4592. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4593. } else {
  4594. xlen = 8
  4595. }
  4596. v = make([]float32, uint(xlen))
  4597. changed = true
  4598. }
  4599. var decodeIntoBlank bool
  4600. if j >= len(v) {
  4601. if canChange {
  4602. v = append(v, 0)
  4603. changed = true
  4604. } else {
  4605. d.arrayCannotExpand(len(v), j+1)
  4606. decodeIntoBlank = true
  4607. }
  4608. }
  4609. slh.ElemContainerState(j)
  4610. if decodeIntoBlank {
  4611. d.swallow()
  4612. } else if d.d.TryDecodeAsNil() {
  4613. v[uint(j)] = 0
  4614. } else {
  4615. v[uint(j)] = float32(d.decodeFloat32())
  4616. }
  4617. }
  4618. if canChange {
  4619. if j < len(v) {
  4620. v = v[:uint(j)]
  4621. changed = true
  4622. } else if j == 0 && v == nil {
  4623. v = make([]float32, 0)
  4624. changed = true
  4625. }
  4626. }
  4627. slh.End()
  4628. return v, changed
  4629. }
  4630. func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  4631. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4632. vp := rv2i(rv).(*[]float64)
  4633. if v, changed := fastpathTV.DecSliceFloat64V(*vp, !array, d); changed {
  4634. *vp = v
  4635. }
  4636. } else {
  4637. v := rv2i(rv).([]float64)
  4638. v2, changed := fastpathTV.DecSliceFloat64V(v, !array, d)
  4639. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4640. copy(v, v2)
  4641. }
  4642. }
  4643. }
  4644. func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) {
  4645. if v, changed := f.DecSliceFloat64V(*vp, true, d); changed {
  4646. *vp = v
  4647. }
  4648. }
  4649. func (fastpathT) DecSliceFloat64V(v []float64, canChange bool, d *Decoder) (_ []float64, changed bool) {
  4650. slh, containerLenS := d.decSliceHelperStart()
  4651. if containerLenS == 0 {
  4652. if canChange {
  4653. if v == nil {
  4654. v = []float64{}
  4655. } else if len(v) != 0 {
  4656. v = v[:0]
  4657. }
  4658. changed = true
  4659. }
  4660. slh.End()
  4661. return v, changed
  4662. }
  4663. hasLen := containerLenS > 0
  4664. var xlen int
  4665. if hasLen && canChange {
  4666. if containerLenS > cap(v) {
  4667. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4668. if xlen <= cap(v) {
  4669. v = v[:uint(xlen)]
  4670. } else {
  4671. v = make([]float64, uint(xlen))
  4672. }
  4673. changed = true
  4674. } else if containerLenS != len(v) {
  4675. v = v[:containerLenS]
  4676. changed = true
  4677. }
  4678. }
  4679. var j int
  4680. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4681. if j == 0 && len(v) == 0 && canChange {
  4682. if hasLen {
  4683. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4684. } else {
  4685. xlen = 8
  4686. }
  4687. v = make([]float64, uint(xlen))
  4688. changed = true
  4689. }
  4690. var decodeIntoBlank bool
  4691. if j >= len(v) {
  4692. if canChange {
  4693. v = append(v, 0)
  4694. changed = true
  4695. } else {
  4696. d.arrayCannotExpand(len(v), j+1)
  4697. decodeIntoBlank = true
  4698. }
  4699. }
  4700. slh.ElemContainerState(j)
  4701. if decodeIntoBlank {
  4702. d.swallow()
  4703. } else if d.d.TryDecodeAsNil() {
  4704. v[uint(j)] = 0
  4705. } else {
  4706. v[uint(j)] = d.d.DecodeFloat64()
  4707. }
  4708. }
  4709. if canChange {
  4710. if j < len(v) {
  4711. v = v[:uint(j)]
  4712. changed = true
  4713. } else if j == 0 && v == nil {
  4714. v = make([]float64, 0)
  4715. changed = true
  4716. }
  4717. }
  4718. slh.End()
  4719. return v, changed
  4720. }
  4721. func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) {
  4722. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4723. vp := rv2i(rv).(*[]uint)
  4724. if v, changed := fastpathTV.DecSliceUintV(*vp, !array, d); changed {
  4725. *vp = v
  4726. }
  4727. } else {
  4728. v := rv2i(rv).([]uint)
  4729. v2, changed := fastpathTV.DecSliceUintV(v, !array, d)
  4730. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4731. copy(v, v2)
  4732. }
  4733. }
  4734. }
  4735. func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) {
  4736. if v, changed := f.DecSliceUintV(*vp, true, d); changed {
  4737. *vp = v
  4738. }
  4739. }
  4740. func (fastpathT) DecSliceUintV(v []uint, canChange bool, d *Decoder) (_ []uint, changed bool) {
  4741. slh, containerLenS := d.decSliceHelperStart()
  4742. if containerLenS == 0 {
  4743. if canChange {
  4744. if v == nil {
  4745. v = []uint{}
  4746. } else if len(v) != 0 {
  4747. v = v[:0]
  4748. }
  4749. changed = true
  4750. }
  4751. slh.End()
  4752. return v, changed
  4753. }
  4754. hasLen := containerLenS > 0
  4755. var xlen int
  4756. if hasLen && canChange {
  4757. if containerLenS > cap(v) {
  4758. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4759. if xlen <= cap(v) {
  4760. v = v[:uint(xlen)]
  4761. } else {
  4762. v = make([]uint, uint(xlen))
  4763. }
  4764. changed = true
  4765. } else if containerLenS != len(v) {
  4766. v = v[:containerLenS]
  4767. changed = true
  4768. }
  4769. }
  4770. var j int
  4771. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4772. if j == 0 && len(v) == 0 && canChange {
  4773. if hasLen {
  4774. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4775. } else {
  4776. xlen = 8
  4777. }
  4778. v = make([]uint, uint(xlen))
  4779. changed = true
  4780. }
  4781. var decodeIntoBlank bool
  4782. if j >= len(v) {
  4783. if canChange {
  4784. v = append(v, 0)
  4785. changed = true
  4786. } else {
  4787. d.arrayCannotExpand(len(v), j+1)
  4788. decodeIntoBlank = true
  4789. }
  4790. }
  4791. slh.ElemContainerState(j)
  4792. if decodeIntoBlank {
  4793. d.swallow()
  4794. } else if d.d.TryDecodeAsNil() {
  4795. v[uint(j)] = 0
  4796. } else {
  4797. v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  4798. }
  4799. }
  4800. if canChange {
  4801. if j < len(v) {
  4802. v = v[:uint(j)]
  4803. changed = true
  4804. } else if j == 0 && v == nil {
  4805. v = make([]uint, 0)
  4806. changed = true
  4807. }
  4808. }
  4809. slh.End()
  4810. return v, changed
  4811. }
  4812. func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  4813. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4814. vp := rv2i(rv).(*[]uint16)
  4815. if v, changed := fastpathTV.DecSliceUint16V(*vp, !array, d); changed {
  4816. *vp = v
  4817. }
  4818. } else {
  4819. v := rv2i(rv).([]uint16)
  4820. v2, changed := fastpathTV.DecSliceUint16V(v, !array, d)
  4821. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4822. copy(v, v2)
  4823. }
  4824. }
  4825. }
  4826. func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) {
  4827. if v, changed := f.DecSliceUint16V(*vp, true, d); changed {
  4828. *vp = v
  4829. }
  4830. }
  4831. func (fastpathT) DecSliceUint16V(v []uint16, canChange bool, d *Decoder) (_ []uint16, changed bool) {
  4832. slh, containerLenS := d.decSliceHelperStart()
  4833. if containerLenS == 0 {
  4834. if canChange {
  4835. if v == nil {
  4836. v = []uint16{}
  4837. } else if len(v) != 0 {
  4838. v = v[:0]
  4839. }
  4840. changed = true
  4841. }
  4842. slh.End()
  4843. return v, changed
  4844. }
  4845. hasLen := containerLenS > 0
  4846. var xlen int
  4847. if hasLen && canChange {
  4848. if containerLenS > cap(v) {
  4849. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  4850. if xlen <= cap(v) {
  4851. v = v[:uint(xlen)]
  4852. } else {
  4853. v = make([]uint16, uint(xlen))
  4854. }
  4855. changed = true
  4856. } else if containerLenS != len(v) {
  4857. v = v[:containerLenS]
  4858. changed = true
  4859. }
  4860. }
  4861. var j int
  4862. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4863. if j == 0 && len(v) == 0 && canChange {
  4864. if hasLen {
  4865. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  4866. } else {
  4867. xlen = 8
  4868. }
  4869. v = make([]uint16, uint(xlen))
  4870. changed = true
  4871. }
  4872. var decodeIntoBlank bool
  4873. if j >= len(v) {
  4874. if canChange {
  4875. v = append(v, 0)
  4876. changed = true
  4877. } else {
  4878. d.arrayCannotExpand(len(v), j+1)
  4879. decodeIntoBlank = true
  4880. }
  4881. }
  4882. slh.ElemContainerState(j)
  4883. if decodeIntoBlank {
  4884. d.swallow()
  4885. } else if d.d.TryDecodeAsNil() {
  4886. v[uint(j)] = 0
  4887. } else {
  4888. v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
  4889. }
  4890. }
  4891. if canChange {
  4892. if j < len(v) {
  4893. v = v[:uint(j)]
  4894. changed = true
  4895. } else if j == 0 && v == nil {
  4896. v = make([]uint16, 0)
  4897. changed = true
  4898. }
  4899. }
  4900. slh.End()
  4901. return v, changed
  4902. }
  4903. func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  4904. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4905. vp := rv2i(rv).(*[]uint32)
  4906. if v, changed := fastpathTV.DecSliceUint32V(*vp, !array, d); changed {
  4907. *vp = v
  4908. }
  4909. } else {
  4910. v := rv2i(rv).([]uint32)
  4911. v2, changed := fastpathTV.DecSliceUint32V(v, !array, d)
  4912. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4913. copy(v, v2)
  4914. }
  4915. }
  4916. }
  4917. func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) {
  4918. if v, changed := f.DecSliceUint32V(*vp, true, d); changed {
  4919. *vp = v
  4920. }
  4921. }
  4922. func (fastpathT) DecSliceUint32V(v []uint32, canChange bool, d *Decoder) (_ []uint32, changed bool) {
  4923. slh, containerLenS := d.decSliceHelperStart()
  4924. if containerLenS == 0 {
  4925. if canChange {
  4926. if v == nil {
  4927. v = []uint32{}
  4928. } else if len(v) != 0 {
  4929. v = v[:0]
  4930. }
  4931. changed = true
  4932. }
  4933. slh.End()
  4934. return v, changed
  4935. }
  4936. hasLen := containerLenS > 0
  4937. var xlen int
  4938. if hasLen && canChange {
  4939. if containerLenS > cap(v) {
  4940. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4941. if xlen <= cap(v) {
  4942. v = v[:uint(xlen)]
  4943. } else {
  4944. v = make([]uint32, uint(xlen))
  4945. }
  4946. changed = true
  4947. } else if containerLenS != len(v) {
  4948. v = v[:containerLenS]
  4949. changed = true
  4950. }
  4951. }
  4952. var j int
  4953. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4954. if j == 0 && len(v) == 0 && canChange {
  4955. if hasLen {
  4956. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4957. } else {
  4958. xlen = 8
  4959. }
  4960. v = make([]uint32, uint(xlen))
  4961. changed = true
  4962. }
  4963. var decodeIntoBlank bool
  4964. if j >= len(v) {
  4965. if canChange {
  4966. v = append(v, 0)
  4967. changed = true
  4968. } else {
  4969. d.arrayCannotExpand(len(v), j+1)
  4970. decodeIntoBlank = true
  4971. }
  4972. }
  4973. slh.ElemContainerState(j)
  4974. if decodeIntoBlank {
  4975. d.swallow()
  4976. } else if d.d.TryDecodeAsNil() {
  4977. v[uint(j)] = 0
  4978. } else {
  4979. v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
  4980. }
  4981. }
  4982. if canChange {
  4983. if j < len(v) {
  4984. v = v[:uint(j)]
  4985. changed = true
  4986. } else if j == 0 && v == nil {
  4987. v = make([]uint32, 0)
  4988. changed = true
  4989. }
  4990. }
  4991. slh.End()
  4992. return v, changed
  4993. }
  4994. func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  4995. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  4996. vp := rv2i(rv).(*[]uint64)
  4997. if v, changed := fastpathTV.DecSliceUint64V(*vp, !array, d); changed {
  4998. *vp = v
  4999. }
  5000. } else {
  5001. v := rv2i(rv).([]uint64)
  5002. v2, changed := fastpathTV.DecSliceUint64V(v, !array, d)
  5003. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5004. copy(v, v2)
  5005. }
  5006. }
  5007. }
  5008. func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) {
  5009. if v, changed := f.DecSliceUint64V(*vp, true, d); changed {
  5010. *vp = v
  5011. }
  5012. }
  5013. func (fastpathT) DecSliceUint64V(v []uint64, canChange bool, d *Decoder) (_ []uint64, changed bool) {
  5014. slh, containerLenS := d.decSliceHelperStart()
  5015. if containerLenS == 0 {
  5016. if canChange {
  5017. if v == nil {
  5018. v = []uint64{}
  5019. } else if len(v) != 0 {
  5020. v = v[:0]
  5021. }
  5022. changed = true
  5023. }
  5024. slh.End()
  5025. return v, changed
  5026. }
  5027. hasLen := containerLenS > 0
  5028. var xlen int
  5029. if hasLen && canChange {
  5030. if containerLenS > cap(v) {
  5031. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5032. if xlen <= cap(v) {
  5033. v = v[:uint(xlen)]
  5034. } else {
  5035. v = make([]uint64, uint(xlen))
  5036. }
  5037. changed = true
  5038. } else if containerLenS != len(v) {
  5039. v = v[:containerLenS]
  5040. changed = true
  5041. }
  5042. }
  5043. var j int
  5044. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5045. if j == 0 && len(v) == 0 && canChange {
  5046. if hasLen {
  5047. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5048. } else {
  5049. xlen = 8
  5050. }
  5051. v = make([]uint64, uint(xlen))
  5052. changed = true
  5053. }
  5054. var decodeIntoBlank bool
  5055. if j >= len(v) {
  5056. if canChange {
  5057. v = append(v, 0)
  5058. changed = true
  5059. } else {
  5060. d.arrayCannotExpand(len(v), j+1)
  5061. decodeIntoBlank = true
  5062. }
  5063. }
  5064. slh.ElemContainerState(j)
  5065. if decodeIntoBlank {
  5066. d.swallow()
  5067. } else if d.d.TryDecodeAsNil() {
  5068. v[uint(j)] = 0
  5069. } else {
  5070. v[uint(j)] = d.d.DecodeUint64()
  5071. }
  5072. }
  5073. if canChange {
  5074. if j < len(v) {
  5075. v = v[:uint(j)]
  5076. changed = true
  5077. } else if j == 0 && v == nil {
  5078. v = make([]uint64, 0)
  5079. changed = true
  5080. }
  5081. }
  5082. slh.End()
  5083. return v, changed
  5084. }
  5085. func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) {
  5086. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5087. vp := rv2i(rv).(*[]int)
  5088. if v, changed := fastpathTV.DecSliceIntV(*vp, !array, d); changed {
  5089. *vp = v
  5090. }
  5091. } else {
  5092. v := rv2i(rv).([]int)
  5093. v2, changed := fastpathTV.DecSliceIntV(v, !array, d)
  5094. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5095. copy(v, v2)
  5096. }
  5097. }
  5098. }
  5099. func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) {
  5100. if v, changed := f.DecSliceIntV(*vp, true, d); changed {
  5101. *vp = v
  5102. }
  5103. }
  5104. func (fastpathT) DecSliceIntV(v []int, canChange bool, d *Decoder) (_ []int, changed bool) {
  5105. slh, containerLenS := d.decSliceHelperStart()
  5106. if containerLenS == 0 {
  5107. if canChange {
  5108. if v == nil {
  5109. v = []int{}
  5110. } else if len(v) != 0 {
  5111. v = v[:0]
  5112. }
  5113. changed = true
  5114. }
  5115. slh.End()
  5116. return v, changed
  5117. }
  5118. hasLen := containerLenS > 0
  5119. var xlen int
  5120. if hasLen && canChange {
  5121. if containerLenS > cap(v) {
  5122. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5123. if xlen <= cap(v) {
  5124. v = v[:uint(xlen)]
  5125. } else {
  5126. v = make([]int, uint(xlen))
  5127. }
  5128. changed = true
  5129. } else if containerLenS != len(v) {
  5130. v = v[:containerLenS]
  5131. changed = true
  5132. }
  5133. }
  5134. var j int
  5135. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5136. if j == 0 && len(v) == 0 && canChange {
  5137. if hasLen {
  5138. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5139. } else {
  5140. xlen = 8
  5141. }
  5142. v = make([]int, uint(xlen))
  5143. changed = true
  5144. }
  5145. var decodeIntoBlank bool
  5146. if j >= len(v) {
  5147. if canChange {
  5148. v = append(v, 0)
  5149. changed = true
  5150. } else {
  5151. d.arrayCannotExpand(len(v), j+1)
  5152. decodeIntoBlank = true
  5153. }
  5154. }
  5155. slh.ElemContainerState(j)
  5156. if decodeIntoBlank {
  5157. d.swallow()
  5158. } else if d.d.TryDecodeAsNil() {
  5159. v[uint(j)] = 0
  5160. } else {
  5161. v[uint(j)] = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  5162. }
  5163. }
  5164. if canChange {
  5165. if j < len(v) {
  5166. v = v[:uint(j)]
  5167. changed = true
  5168. } else if j == 0 && v == nil {
  5169. v = make([]int, 0)
  5170. changed = true
  5171. }
  5172. }
  5173. slh.End()
  5174. return v, changed
  5175. }
  5176. func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  5177. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5178. vp := rv2i(rv).(*[]int8)
  5179. if v, changed := fastpathTV.DecSliceInt8V(*vp, !array, d); changed {
  5180. *vp = v
  5181. }
  5182. } else {
  5183. v := rv2i(rv).([]int8)
  5184. v2, changed := fastpathTV.DecSliceInt8V(v, !array, d)
  5185. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5186. copy(v, v2)
  5187. }
  5188. }
  5189. }
  5190. func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) {
  5191. if v, changed := f.DecSliceInt8V(*vp, true, d); changed {
  5192. *vp = v
  5193. }
  5194. }
  5195. func (fastpathT) DecSliceInt8V(v []int8, canChange bool, d *Decoder) (_ []int8, changed bool) {
  5196. slh, containerLenS := d.decSliceHelperStart()
  5197. if containerLenS == 0 {
  5198. if canChange {
  5199. if v == nil {
  5200. v = []int8{}
  5201. } else if len(v) != 0 {
  5202. v = v[:0]
  5203. }
  5204. changed = true
  5205. }
  5206. slh.End()
  5207. return v, changed
  5208. }
  5209. hasLen := containerLenS > 0
  5210. var xlen int
  5211. if hasLen && canChange {
  5212. if containerLenS > cap(v) {
  5213. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5214. if xlen <= cap(v) {
  5215. v = v[:uint(xlen)]
  5216. } else {
  5217. v = make([]int8, uint(xlen))
  5218. }
  5219. changed = true
  5220. } else if containerLenS != len(v) {
  5221. v = v[:containerLenS]
  5222. changed = true
  5223. }
  5224. }
  5225. var j int
  5226. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5227. if j == 0 && len(v) == 0 && canChange {
  5228. if hasLen {
  5229. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5230. } else {
  5231. xlen = 8
  5232. }
  5233. v = make([]int8, uint(xlen))
  5234. changed = true
  5235. }
  5236. var decodeIntoBlank bool
  5237. if j >= len(v) {
  5238. if canChange {
  5239. v = append(v, 0)
  5240. changed = true
  5241. } else {
  5242. d.arrayCannotExpand(len(v), j+1)
  5243. decodeIntoBlank = true
  5244. }
  5245. }
  5246. slh.ElemContainerState(j)
  5247. if decodeIntoBlank {
  5248. d.swallow()
  5249. } else if d.d.TryDecodeAsNil() {
  5250. v[uint(j)] = 0
  5251. } else {
  5252. v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
  5253. }
  5254. }
  5255. if canChange {
  5256. if j < len(v) {
  5257. v = v[:uint(j)]
  5258. changed = true
  5259. } else if j == 0 && v == nil {
  5260. v = make([]int8, 0)
  5261. changed = true
  5262. }
  5263. }
  5264. slh.End()
  5265. return v, changed
  5266. }
  5267. func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  5268. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5269. vp := rv2i(rv).(*[]int16)
  5270. if v, changed := fastpathTV.DecSliceInt16V(*vp, !array, d); changed {
  5271. *vp = v
  5272. }
  5273. } else {
  5274. v := rv2i(rv).([]int16)
  5275. v2, changed := fastpathTV.DecSliceInt16V(v, !array, d)
  5276. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5277. copy(v, v2)
  5278. }
  5279. }
  5280. }
  5281. func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) {
  5282. if v, changed := f.DecSliceInt16V(*vp, true, d); changed {
  5283. *vp = v
  5284. }
  5285. }
  5286. func (fastpathT) DecSliceInt16V(v []int16, canChange bool, d *Decoder) (_ []int16, changed bool) {
  5287. slh, containerLenS := d.decSliceHelperStart()
  5288. if containerLenS == 0 {
  5289. if canChange {
  5290. if v == nil {
  5291. v = []int16{}
  5292. } else if len(v) != 0 {
  5293. v = v[:0]
  5294. }
  5295. changed = true
  5296. }
  5297. slh.End()
  5298. return v, changed
  5299. }
  5300. hasLen := containerLenS > 0
  5301. var xlen int
  5302. if hasLen && canChange {
  5303. if containerLenS > cap(v) {
  5304. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  5305. if xlen <= cap(v) {
  5306. v = v[:uint(xlen)]
  5307. } else {
  5308. v = make([]int16, uint(xlen))
  5309. }
  5310. changed = true
  5311. } else if containerLenS != len(v) {
  5312. v = v[:containerLenS]
  5313. changed = true
  5314. }
  5315. }
  5316. var j int
  5317. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5318. if j == 0 && len(v) == 0 && canChange {
  5319. if hasLen {
  5320. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  5321. } else {
  5322. xlen = 8
  5323. }
  5324. v = make([]int16, uint(xlen))
  5325. changed = true
  5326. }
  5327. var decodeIntoBlank bool
  5328. if j >= len(v) {
  5329. if canChange {
  5330. v = append(v, 0)
  5331. changed = true
  5332. } else {
  5333. d.arrayCannotExpand(len(v), j+1)
  5334. decodeIntoBlank = true
  5335. }
  5336. }
  5337. slh.ElemContainerState(j)
  5338. if decodeIntoBlank {
  5339. d.swallow()
  5340. } else if d.d.TryDecodeAsNil() {
  5341. v[uint(j)] = 0
  5342. } else {
  5343. v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
  5344. }
  5345. }
  5346. if canChange {
  5347. if j < len(v) {
  5348. v = v[:uint(j)]
  5349. changed = true
  5350. } else if j == 0 && v == nil {
  5351. v = make([]int16, 0)
  5352. changed = true
  5353. }
  5354. }
  5355. slh.End()
  5356. return v, changed
  5357. }
  5358. func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  5359. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5360. vp := rv2i(rv).(*[]int32)
  5361. if v, changed := fastpathTV.DecSliceInt32V(*vp, !array, d); changed {
  5362. *vp = v
  5363. }
  5364. } else {
  5365. v := rv2i(rv).([]int32)
  5366. v2, changed := fastpathTV.DecSliceInt32V(v, !array, d)
  5367. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5368. copy(v, v2)
  5369. }
  5370. }
  5371. }
  5372. func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) {
  5373. if v, changed := f.DecSliceInt32V(*vp, true, d); changed {
  5374. *vp = v
  5375. }
  5376. }
  5377. func (fastpathT) DecSliceInt32V(v []int32, canChange bool, d *Decoder) (_ []int32, changed bool) {
  5378. slh, containerLenS := d.decSliceHelperStart()
  5379. if containerLenS == 0 {
  5380. if canChange {
  5381. if v == nil {
  5382. v = []int32{}
  5383. } else if len(v) != 0 {
  5384. v = v[:0]
  5385. }
  5386. changed = true
  5387. }
  5388. slh.End()
  5389. return v, changed
  5390. }
  5391. hasLen := containerLenS > 0
  5392. var xlen int
  5393. if hasLen && canChange {
  5394. if containerLenS > cap(v) {
  5395. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5396. if xlen <= cap(v) {
  5397. v = v[:uint(xlen)]
  5398. } else {
  5399. v = make([]int32, uint(xlen))
  5400. }
  5401. changed = true
  5402. } else if containerLenS != len(v) {
  5403. v = v[:containerLenS]
  5404. changed = true
  5405. }
  5406. }
  5407. var j int
  5408. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5409. if j == 0 && len(v) == 0 && canChange {
  5410. if hasLen {
  5411. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5412. } else {
  5413. xlen = 8
  5414. }
  5415. v = make([]int32, uint(xlen))
  5416. changed = true
  5417. }
  5418. var decodeIntoBlank bool
  5419. if j >= len(v) {
  5420. if canChange {
  5421. v = append(v, 0)
  5422. changed = true
  5423. } else {
  5424. d.arrayCannotExpand(len(v), j+1)
  5425. decodeIntoBlank = true
  5426. }
  5427. }
  5428. slh.ElemContainerState(j)
  5429. if decodeIntoBlank {
  5430. d.swallow()
  5431. } else if d.d.TryDecodeAsNil() {
  5432. v[uint(j)] = 0
  5433. } else {
  5434. v[uint(j)] = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
  5435. }
  5436. }
  5437. if canChange {
  5438. if j < len(v) {
  5439. v = v[:uint(j)]
  5440. changed = true
  5441. } else if j == 0 && v == nil {
  5442. v = make([]int32, 0)
  5443. changed = true
  5444. }
  5445. }
  5446. slh.End()
  5447. return v, changed
  5448. }
  5449. func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  5450. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5451. vp := rv2i(rv).(*[]int64)
  5452. if v, changed := fastpathTV.DecSliceInt64V(*vp, !array, d); changed {
  5453. *vp = v
  5454. }
  5455. } else {
  5456. v := rv2i(rv).([]int64)
  5457. v2, changed := fastpathTV.DecSliceInt64V(v, !array, d)
  5458. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5459. copy(v, v2)
  5460. }
  5461. }
  5462. }
  5463. func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) {
  5464. if v, changed := f.DecSliceInt64V(*vp, true, d); changed {
  5465. *vp = v
  5466. }
  5467. }
  5468. func (fastpathT) DecSliceInt64V(v []int64, canChange bool, d *Decoder) (_ []int64, changed bool) {
  5469. slh, containerLenS := d.decSliceHelperStart()
  5470. if containerLenS == 0 {
  5471. if canChange {
  5472. if v == nil {
  5473. v = []int64{}
  5474. } else if len(v) != 0 {
  5475. v = v[:0]
  5476. }
  5477. changed = true
  5478. }
  5479. slh.End()
  5480. return v, changed
  5481. }
  5482. hasLen := containerLenS > 0
  5483. var xlen int
  5484. if hasLen && canChange {
  5485. if containerLenS > cap(v) {
  5486. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5487. if xlen <= cap(v) {
  5488. v = v[:uint(xlen)]
  5489. } else {
  5490. v = make([]int64, uint(xlen))
  5491. }
  5492. changed = true
  5493. } else if containerLenS != len(v) {
  5494. v = v[:containerLenS]
  5495. changed = true
  5496. }
  5497. }
  5498. var j int
  5499. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5500. if j == 0 && len(v) == 0 && canChange {
  5501. if hasLen {
  5502. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5503. } else {
  5504. xlen = 8
  5505. }
  5506. v = make([]int64, uint(xlen))
  5507. changed = true
  5508. }
  5509. var decodeIntoBlank bool
  5510. if j >= len(v) {
  5511. if canChange {
  5512. v = append(v, 0)
  5513. changed = true
  5514. } else {
  5515. d.arrayCannotExpand(len(v), j+1)
  5516. decodeIntoBlank = true
  5517. }
  5518. }
  5519. slh.ElemContainerState(j)
  5520. if decodeIntoBlank {
  5521. d.swallow()
  5522. } else if d.d.TryDecodeAsNil() {
  5523. v[uint(j)] = 0
  5524. } else {
  5525. v[uint(j)] = d.d.DecodeInt64()
  5526. }
  5527. }
  5528. if canChange {
  5529. if j < len(v) {
  5530. v = v[:uint(j)]
  5531. changed = true
  5532. } else if j == 0 && v == nil {
  5533. v = make([]int64, 0)
  5534. changed = true
  5535. }
  5536. }
  5537. slh.End()
  5538. return v, changed
  5539. }
  5540. func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  5541. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5542. vp := rv2i(rv).(*[]bool)
  5543. if v, changed := fastpathTV.DecSliceBoolV(*vp, !array, d); changed {
  5544. *vp = v
  5545. }
  5546. } else {
  5547. v := rv2i(rv).([]bool)
  5548. v2, changed := fastpathTV.DecSliceBoolV(v, !array, d)
  5549. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5550. copy(v, v2)
  5551. }
  5552. }
  5553. }
  5554. func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) {
  5555. if v, changed := f.DecSliceBoolV(*vp, true, d); changed {
  5556. *vp = v
  5557. }
  5558. }
  5559. func (fastpathT) DecSliceBoolV(v []bool, canChange bool, d *Decoder) (_ []bool, changed bool) {
  5560. slh, containerLenS := d.decSliceHelperStart()
  5561. if containerLenS == 0 {
  5562. if canChange {
  5563. if v == nil {
  5564. v = []bool{}
  5565. } else if len(v) != 0 {
  5566. v = v[:0]
  5567. }
  5568. changed = true
  5569. }
  5570. slh.End()
  5571. return v, changed
  5572. }
  5573. hasLen := containerLenS > 0
  5574. var xlen int
  5575. if hasLen && canChange {
  5576. if containerLenS > cap(v) {
  5577. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5578. if xlen <= cap(v) {
  5579. v = v[:uint(xlen)]
  5580. } else {
  5581. v = make([]bool, uint(xlen))
  5582. }
  5583. changed = true
  5584. } else if containerLenS != len(v) {
  5585. v = v[:containerLenS]
  5586. changed = true
  5587. }
  5588. }
  5589. var j int
  5590. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5591. if j == 0 && len(v) == 0 && canChange {
  5592. if hasLen {
  5593. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5594. } else {
  5595. xlen = 8
  5596. }
  5597. v = make([]bool, uint(xlen))
  5598. changed = true
  5599. }
  5600. var decodeIntoBlank bool
  5601. if j >= len(v) {
  5602. if canChange {
  5603. v = append(v, false)
  5604. changed = true
  5605. } else {
  5606. d.arrayCannotExpand(len(v), j+1)
  5607. decodeIntoBlank = true
  5608. }
  5609. }
  5610. slh.ElemContainerState(j)
  5611. if decodeIntoBlank {
  5612. d.swallow()
  5613. } else if d.d.TryDecodeAsNil() {
  5614. v[uint(j)] = false
  5615. } else {
  5616. v[uint(j)] = d.d.DecodeBool()
  5617. }
  5618. }
  5619. if canChange {
  5620. if j < len(v) {
  5621. v = v[:uint(j)]
  5622. changed = true
  5623. } else if j == 0 && v == nil {
  5624. v = make([]bool, 0)
  5625. changed = true
  5626. }
  5627. }
  5628. slh.End()
  5629. return v, changed
  5630. }
  5631. func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  5632. if rv.Kind() == reflect.Ptr {
  5633. vp := rv2i(rv).(*map[string]interface{})
  5634. if v, changed := fastpathTV.DecMapStringIntfV(*vp, true, d); changed {
  5635. *vp = v
  5636. }
  5637. } else {
  5638. fastpathTV.DecMapStringIntfV(rv2i(rv).(map[string]interface{}), false, d)
  5639. }
  5640. }
  5641. func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
  5642. if v, changed := f.DecMapStringIntfV(*vp, true, d); changed {
  5643. *vp = v
  5644. }
  5645. }
  5646. func (fastpathT) DecMapStringIntfV(v map[string]interface{}, canChange bool,
  5647. d *Decoder) (_ map[string]interface{}, changed bool) {
  5648. containerLen := d.mapStart()
  5649. if canChange && v == nil {
  5650. v = make(map[string]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5651. changed = true
  5652. }
  5653. if containerLen == 0 {
  5654. d.mapEnd()
  5655. return v, changed
  5656. }
  5657. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  5658. var mk string
  5659. var mv interface{}
  5660. hasLen := containerLen > 0
  5661. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5662. d.mapElemKey()
  5663. mk = d.d.DecodeString()
  5664. d.mapElemValue()
  5665. if d.d.TryDecodeAsNil() {
  5666. if v == nil {
  5667. } else if d.h.DeleteOnNilMapValue {
  5668. delete(v, mk)
  5669. } else {
  5670. v[mk] = nil
  5671. }
  5672. continue
  5673. }
  5674. if mapGet {
  5675. mv = v[mk]
  5676. } else {
  5677. mv = nil
  5678. }
  5679. d.decode(&mv)
  5680. if v != nil {
  5681. v[mk] = mv
  5682. }
  5683. }
  5684. d.mapEnd()
  5685. return v, changed
  5686. }
  5687. func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  5688. if rv.Kind() == reflect.Ptr {
  5689. vp := rv2i(rv).(*map[string]string)
  5690. if v, changed := fastpathTV.DecMapStringStringV(*vp, true, d); changed {
  5691. *vp = v
  5692. }
  5693. } else {
  5694. fastpathTV.DecMapStringStringV(rv2i(rv).(map[string]string), false, d)
  5695. }
  5696. }
  5697. func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
  5698. if v, changed := f.DecMapStringStringV(*vp, true, d); changed {
  5699. *vp = v
  5700. }
  5701. }
  5702. func (fastpathT) DecMapStringStringV(v map[string]string, canChange bool,
  5703. d *Decoder) (_ map[string]string, changed bool) {
  5704. containerLen := d.mapStart()
  5705. if canChange && v == nil {
  5706. v = make(map[string]string, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5707. changed = true
  5708. }
  5709. if containerLen == 0 {
  5710. d.mapEnd()
  5711. return v, changed
  5712. }
  5713. var mk string
  5714. var mv string
  5715. hasLen := containerLen > 0
  5716. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5717. d.mapElemKey()
  5718. mk = d.d.DecodeString()
  5719. d.mapElemValue()
  5720. if d.d.TryDecodeAsNil() {
  5721. if v == nil {
  5722. } else if d.h.DeleteOnNilMapValue {
  5723. delete(v, mk)
  5724. } else {
  5725. v[mk] = ""
  5726. }
  5727. continue
  5728. }
  5729. mv = d.d.DecodeString()
  5730. if v != nil {
  5731. v[mk] = mv
  5732. }
  5733. }
  5734. d.mapEnd()
  5735. return v, changed
  5736. }
  5737. func (d *Decoder) fastpathDecMapStringBytesR(f *codecFnInfo, rv reflect.Value) {
  5738. if rv.Kind() == reflect.Ptr {
  5739. vp := rv2i(rv).(*map[string][]byte)
  5740. if v, changed := fastpathTV.DecMapStringBytesV(*vp, true, d); changed {
  5741. *vp = v
  5742. }
  5743. } else {
  5744. fastpathTV.DecMapStringBytesV(rv2i(rv).(map[string][]byte), false, d)
  5745. }
  5746. }
  5747. func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) {
  5748. if v, changed := f.DecMapStringBytesV(*vp, true, d); changed {
  5749. *vp = v
  5750. }
  5751. }
  5752. func (fastpathT) DecMapStringBytesV(v map[string][]byte, canChange bool,
  5753. d *Decoder) (_ map[string][]byte, changed bool) {
  5754. containerLen := d.mapStart()
  5755. if canChange && v == nil {
  5756. v = make(map[string][]byte, decInferLen(containerLen, d.h.MaxInitLen, 40))
  5757. changed = true
  5758. }
  5759. if containerLen == 0 {
  5760. d.mapEnd()
  5761. return v, changed
  5762. }
  5763. mapGet := v != nil && !d.h.MapValueReset
  5764. var mk string
  5765. var mv []byte
  5766. hasLen := containerLen > 0
  5767. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5768. d.mapElemKey()
  5769. mk = d.d.DecodeString()
  5770. d.mapElemValue()
  5771. if d.d.TryDecodeAsNil() {
  5772. if v == nil {
  5773. } else if d.h.DeleteOnNilMapValue {
  5774. delete(v, mk)
  5775. } else {
  5776. v[mk] = nil
  5777. }
  5778. continue
  5779. }
  5780. if mapGet {
  5781. mv = v[mk]
  5782. } else {
  5783. mv = nil
  5784. }
  5785. mv = d.d.DecodeBytes(mv, false)
  5786. if v != nil {
  5787. v[mk] = mv
  5788. }
  5789. }
  5790. d.mapEnd()
  5791. return v, changed
  5792. }
  5793. func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  5794. if rv.Kind() == reflect.Ptr {
  5795. vp := rv2i(rv).(*map[string]uint)
  5796. if v, changed := fastpathTV.DecMapStringUintV(*vp, true, d); changed {
  5797. *vp = v
  5798. }
  5799. } else {
  5800. fastpathTV.DecMapStringUintV(rv2i(rv).(map[string]uint), false, d)
  5801. }
  5802. }
  5803. func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) {
  5804. if v, changed := f.DecMapStringUintV(*vp, true, d); changed {
  5805. *vp = v
  5806. }
  5807. }
  5808. func (fastpathT) DecMapStringUintV(v map[string]uint, canChange bool,
  5809. d *Decoder) (_ map[string]uint, changed bool) {
  5810. containerLen := d.mapStart()
  5811. if canChange && v == nil {
  5812. v = make(map[string]uint, decInferLen(containerLen, d.h.MaxInitLen, 24))
  5813. changed = true
  5814. }
  5815. if containerLen == 0 {
  5816. d.mapEnd()
  5817. return v, changed
  5818. }
  5819. var mk string
  5820. var mv uint
  5821. hasLen := containerLen > 0
  5822. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5823. d.mapElemKey()
  5824. mk = d.d.DecodeString()
  5825. d.mapElemValue()
  5826. if d.d.TryDecodeAsNil() {
  5827. if v == nil {
  5828. } else if d.h.DeleteOnNilMapValue {
  5829. delete(v, mk)
  5830. } else {
  5831. v[mk] = 0
  5832. }
  5833. continue
  5834. }
  5835. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  5836. if v != nil {
  5837. v[mk] = mv
  5838. }
  5839. }
  5840. d.mapEnd()
  5841. return v, changed
  5842. }
  5843. func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  5844. if rv.Kind() == reflect.Ptr {
  5845. vp := rv2i(rv).(*map[string]uint8)
  5846. if v, changed := fastpathTV.DecMapStringUint8V(*vp, true, d); changed {
  5847. *vp = v
  5848. }
  5849. } else {
  5850. fastpathTV.DecMapStringUint8V(rv2i(rv).(map[string]uint8), false, d)
  5851. }
  5852. }
  5853. func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
  5854. if v, changed := f.DecMapStringUint8V(*vp, true, d); changed {
  5855. *vp = v
  5856. }
  5857. }
  5858. func (fastpathT) DecMapStringUint8V(v map[string]uint8, canChange bool,
  5859. d *Decoder) (_ map[string]uint8, changed bool) {
  5860. containerLen := d.mapStart()
  5861. if canChange && v == nil {
  5862. v = make(map[string]uint8, decInferLen(containerLen, d.h.MaxInitLen, 17))
  5863. changed = true
  5864. }
  5865. if containerLen == 0 {
  5866. d.mapEnd()
  5867. return v, changed
  5868. }
  5869. var mk string
  5870. var mv uint8
  5871. hasLen := containerLen > 0
  5872. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5873. d.mapElemKey()
  5874. mk = d.d.DecodeString()
  5875. d.mapElemValue()
  5876. if d.d.TryDecodeAsNil() {
  5877. if v == nil {
  5878. } else if d.h.DeleteOnNilMapValue {
  5879. delete(v, mk)
  5880. } else {
  5881. v[mk] = 0
  5882. }
  5883. continue
  5884. }
  5885. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  5886. if v != nil {
  5887. v[mk] = mv
  5888. }
  5889. }
  5890. d.mapEnd()
  5891. return v, changed
  5892. }
  5893. func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  5894. if rv.Kind() == reflect.Ptr {
  5895. vp := rv2i(rv).(*map[string]uint64)
  5896. if v, changed := fastpathTV.DecMapStringUint64V(*vp, true, d); changed {
  5897. *vp = v
  5898. }
  5899. } else {
  5900. fastpathTV.DecMapStringUint64V(rv2i(rv).(map[string]uint64), false, d)
  5901. }
  5902. }
  5903. func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
  5904. if v, changed := f.DecMapStringUint64V(*vp, true, d); changed {
  5905. *vp = v
  5906. }
  5907. }
  5908. func (fastpathT) DecMapStringUint64V(v map[string]uint64, canChange bool,
  5909. d *Decoder) (_ map[string]uint64, changed bool) {
  5910. containerLen := d.mapStart()
  5911. if canChange && v == nil {
  5912. v = make(map[string]uint64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  5913. changed = true
  5914. }
  5915. if containerLen == 0 {
  5916. d.mapEnd()
  5917. return v, changed
  5918. }
  5919. var mk string
  5920. var mv uint64
  5921. hasLen := containerLen > 0
  5922. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5923. d.mapElemKey()
  5924. mk = d.d.DecodeString()
  5925. d.mapElemValue()
  5926. if d.d.TryDecodeAsNil() {
  5927. if v == nil {
  5928. } else if d.h.DeleteOnNilMapValue {
  5929. delete(v, mk)
  5930. } else {
  5931. v[mk] = 0
  5932. }
  5933. continue
  5934. }
  5935. mv = d.d.DecodeUint64()
  5936. if v != nil {
  5937. v[mk] = mv
  5938. }
  5939. }
  5940. d.mapEnd()
  5941. return v, changed
  5942. }
  5943. func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  5944. if rv.Kind() == reflect.Ptr {
  5945. vp := rv2i(rv).(*map[string]int)
  5946. if v, changed := fastpathTV.DecMapStringIntV(*vp, true, d); changed {
  5947. *vp = v
  5948. }
  5949. } else {
  5950. fastpathTV.DecMapStringIntV(rv2i(rv).(map[string]int), false, d)
  5951. }
  5952. }
  5953. func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
  5954. if v, changed := f.DecMapStringIntV(*vp, true, d); changed {
  5955. *vp = v
  5956. }
  5957. }
  5958. func (fastpathT) DecMapStringIntV(v map[string]int, canChange bool,
  5959. d *Decoder) (_ map[string]int, changed bool) {
  5960. containerLen := d.mapStart()
  5961. if canChange && v == nil {
  5962. v = make(map[string]int, decInferLen(containerLen, d.h.MaxInitLen, 24))
  5963. changed = true
  5964. }
  5965. if containerLen == 0 {
  5966. d.mapEnd()
  5967. return v, changed
  5968. }
  5969. var mk string
  5970. var mv int
  5971. hasLen := containerLen > 0
  5972. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5973. d.mapElemKey()
  5974. mk = d.d.DecodeString()
  5975. d.mapElemValue()
  5976. if d.d.TryDecodeAsNil() {
  5977. if v == nil {
  5978. } else if d.h.DeleteOnNilMapValue {
  5979. delete(v, mk)
  5980. } else {
  5981. v[mk] = 0
  5982. }
  5983. continue
  5984. }
  5985. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  5986. if v != nil {
  5987. v[mk] = mv
  5988. }
  5989. }
  5990. d.mapEnd()
  5991. return v, changed
  5992. }
  5993. func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  5994. if rv.Kind() == reflect.Ptr {
  5995. vp := rv2i(rv).(*map[string]int64)
  5996. if v, changed := fastpathTV.DecMapStringInt64V(*vp, true, d); changed {
  5997. *vp = v
  5998. }
  5999. } else {
  6000. fastpathTV.DecMapStringInt64V(rv2i(rv).(map[string]int64), false, d)
  6001. }
  6002. }
  6003. func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) {
  6004. if v, changed := f.DecMapStringInt64V(*vp, true, d); changed {
  6005. *vp = v
  6006. }
  6007. }
  6008. func (fastpathT) DecMapStringInt64V(v map[string]int64, canChange bool,
  6009. d *Decoder) (_ map[string]int64, changed bool) {
  6010. containerLen := d.mapStart()
  6011. if canChange && v == nil {
  6012. v = make(map[string]int64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6013. changed = true
  6014. }
  6015. if containerLen == 0 {
  6016. d.mapEnd()
  6017. return v, changed
  6018. }
  6019. var mk string
  6020. var mv int64
  6021. hasLen := containerLen > 0
  6022. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6023. d.mapElemKey()
  6024. mk = d.d.DecodeString()
  6025. d.mapElemValue()
  6026. if d.d.TryDecodeAsNil() {
  6027. if v == nil {
  6028. } else if d.h.DeleteOnNilMapValue {
  6029. delete(v, mk)
  6030. } else {
  6031. v[mk] = 0
  6032. }
  6033. continue
  6034. }
  6035. mv = d.d.DecodeInt64()
  6036. if v != nil {
  6037. v[mk] = mv
  6038. }
  6039. }
  6040. d.mapEnd()
  6041. return v, changed
  6042. }
  6043. func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  6044. if rv.Kind() == reflect.Ptr {
  6045. vp := rv2i(rv).(*map[string]float32)
  6046. if v, changed := fastpathTV.DecMapStringFloat32V(*vp, true, d); changed {
  6047. *vp = v
  6048. }
  6049. } else {
  6050. fastpathTV.DecMapStringFloat32V(rv2i(rv).(map[string]float32), false, d)
  6051. }
  6052. }
  6053. func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) {
  6054. if v, changed := f.DecMapStringFloat32V(*vp, true, d); changed {
  6055. *vp = v
  6056. }
  6057. }
  6058. func (fastpathT) DecMapStringFloat32V(v map[string]float32, canChange bool,
  6059. d *Decoder) (_ map[string]float32, changed bool) {
  6060. containerLen := d.mapStart()
  6061. if canChange && v == nil {
  6062. v = make(map[string]float32, decInferLen(containerLen, d.h.MaxInitLen, 20))
  6063. changed = true
  6064. }
  6065. if containerLen == 0 {
  6066. d.mapEnd()
  6067. return v, changed
  6068. }
  6069. var mk string
  6070. var mv float32
  6071. hasLen := containerLen > 0
  6072. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6073. d.mapElemKey()
  6074. mk = d.d.DecodeString()
  6075. d.mapElemValue()
  6076. if d.d.TryDecodeAsNil() {
  6077. if v == nil {
  6078. } else if d.h.DeleteOnNilMapValue {
  6079. delete(v, mk)
  6080. } else {
  6081. v[mk] = 0
  6082. }
  6083. continue
  6084. }
  6085. mv = float32(d.decodeFloat32())
  6086. if v != nil {
  6087. v[mk] = mv
  6088. }
  6089. }
  6090. d.mapEnd()
  6091. return v, changed
  6092. }
  6093. func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  6094. if rv.Kind() == reflect.Ptr {
  6095. vp := rv2i(rv).(*map[string]float64)
  6096. if v, changed := fastpathTV.DecMapStringFloat64V(*vp, true, d); changed {
  6097. *vp = v
  6098. }
  6099. } else {
  6100. fastpathTV.DecMapStringFloat64V(rv2i(rv).(map[string]float64), false, d)
  6101. }
  6102. }
  6103. func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
  6104. if v, changed := f.DecMapStringFloat64V(*vp, true, d); changed {
  6105. *vp = v
  6106. }
  6107. }
  6108. func (fastpathT) DecMapStringFloat64V(v map[string]float64, canChange bool,
  6109. d *Decoder) (_ map[string]float64, changed bool) {
  6110. containerLen := d.mapStart()
  6111. if canChange && v == nil {
  6112. v = make(map[string]float64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6113. changed = true
  6114. }
  6115. if containerLen == 0 {
  6116. d.mapEnd()
  6117. return v, changed
  6118. }
  6119. var mk string
  6120. var mv float64
  6121. hasLen := containerLen > 0
  6122. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6123. d.mapElemKey()
  6124. mk = d.d.DecodeString()
  6125. d.mapElemValue()
  6126. if d.d.TryDecodeAsNil() {
  6127. if v == nil {
  6128. } else if d.h.DeleteOnNilMapValue {
  6129. delete(v, mk)
  6130. } else {
  6131. v[mk] = 0
  6132. }
  6133. continue
  6134. }
  6135. mv = d.d.DecodeFloat64()
  6136. if v != nil {
  6137. v[mk] = mv
  6138. }
  6139. }
  6140. d.mapEnd()
  6141. return v, changed
  6142. }
  6143. func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  6144. if rv.Kind() == reflect.Ptr {
  6145. vp := rv2i(rv).(*map[string]bool)
  6146. if v, changed := fastpathTV.DecMapStringBoolV(*vp, true, d); changed {
  6147. *vp = v
  6148. }
  6149. } else {
  6150. fastpathTV.DecMapStringBoolV(rv2i(rv).(map[string]bool), false, d)
  6151. }
  6152. }
  6153. func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
  6154. if v, changed := f.DecMapStringBoolV(*vp, true, d); changed {
  6155. *vp = v
  6156. }
  6157. }
  6158. func (fastpathT) DecMapStringBoolV(v map[string]bool, canChange bool,
  6159. d *Decoder) (_ map[string]bool, changed bool) {
  6160. containerLen := d.mapStart()
  6161. if canChange && v == nil {
  6162. v = make(map[string]bool, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6163. changed = true
  6164. }
  6165. if containerLen == 0 {
  6166. d.mapEnd()
  6167. return v, changed
  6168. }
  6169. var mk string
  6170. var mv bool
  6171. hasLen := containerLen > 0
  6172. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6173. d.mapElemKey()
  6174. mk = d.d.DecodeString()
  6175. d.mapElemValue()
  6176. if d.d.TryDecodeAsNil() {
  6177. if v == nil {
  6178. } else if d.h.DeleteOnNilMapValue {
  6179. delete(v, mk)
  6180. } else {
  6181. v[mk] = false
  6182. }
  6183. continue
  6184. }
  6185. mv = d.d.DecodeBool()
  6186. if v != nil {
  6187. v[mk] = mv
  6188. }
  6189. }
  6190. d.mapEnd()
  6191. return v, changed
  6192. }
  6193. func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  6194. if rv.Kind() == reflect.Ptr {
  6195. vp := rv2i(rv).(*map[uint]interface{})
  6196. if v, changed := fastpathTV.DecMapUintIntfV(*vp, true, d); changed {
  6197. *vp = v
  6198. }
  6199. } else {
  6200. fastpathTV.DecMapUintIntfV(rv2i(rv).(map[uint]interface{}), false, d)
  6201. }
  6202. }
  6203. func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) {
  6204. if v, changed := f.DecMapUintIntfV(*vp, true, d); changed {
  6205. *vp = v
  6206. }
  6207. }
  6208. func (fastpathT) DecMapUintIntfV(v map[uint]interface{}, canChange bool,
  6209. d *Decoder) (_ map[uint]interface{}, changed bool) {
  6210. containerLen := d.mapStart()
  6211. if canChange && v == nil {
  6212. v = make(map[uint]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6213. changed = true
  6214. }
  6215. if containerLen == 0 {
  6216. d.mapEnd()
  6217. return v, changed
  6218. }
  6219. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  6220. var mk uint
  6221. var mv interface{}
  6222. hasLen := containerLen > 0
  6223. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6224. d.mapElemKey()
  6225. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6226. d.mapElemValue()
  6227. if d.d.TryDecodeAsNil() {
  6228. if v == nil {
  6229. } else if d.h.DeleteOnNilMapValue {
  6230. delete(v, mk)
  6231. } else {
  6232. v[mk] = nil
  6233. }
  6234. continue
  6235. }
  6236. if mapGet {
  6237. mv = v[mk]
  6238. } else {
  6239. mv = nil
  6240. }
  6241. d.decode(&mv)
  6242. if v != nil {
  6243. v[mk] = mv
  6244. }
  6245. }
  6246. d.mapEnd()
  6247. return v, changed
  6248. }
  6249. func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  6250. if rv.Kind() == reflect.Ptr {
  6251. vp := rv2i(rv).(*map[uint]string)
  6252. if v, changed := fastpathTV.DecMapUintStringV(*vp, true, d); changed {
  6253. *vp = v
  6254. }
  6255. } else {
  6256. fastpathTV.DecMapUintStringV(rv2i(rv).(map[uint]string), false, d)
  6257. }
  6258. }
  6259. func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) {
  6260. if v, changed := f.DecMapUintStringV(*vp, true, d); changed {
  6261. *vp = v
  6262. }
  6263. }
  6264. func (fastpathT) DecMapUintStringV(v map[uint]string, canChange bool,
  6265. d *Decoder) (_ map[uint]string, changed bool) {
  6266. containerLen := d.mapStart()
  6267. if canChange && v == nil {
  6268. v = make(map[uint]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6269. changed = true
  6270. }
  6271. if containerLen == 0 {
  6272. d.mapEnd()
  6273. return v, changed
  6274. }
  6275. var mk uint
  6276. var mv string
  6277. hasLen := containerLen > 0
  6278. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6279. d.mapElemKey()
  6280. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6281. d.mapElemValue()
  6282. if d.d.TryDecodeAsNil() {
  6283. if v == nil {
  6284. } else if d.h.DeleteOnNilMapValue {
  6285. delete(v, mk)
  6286. } else {
  6287. v[mk] = ""
  6288. }
  6289. continue
  6290. }
  6291. mv = d.d.DecodeString()
  6292. if v != nil {
  6293. v[mk] = mv
  6294. }
  6295. }
  6296. d.mapEnd()
  6297. return v, changed
  6298. }
  6299. func (d *Decoder) fastpathDecMapUintBytesR(f *codecFnInfo, rv reflect.Value) {
  6300. if rv.Kind() == reflect.Ptr {
  6301. vp := rv2i(rv).(*map[uint][]byte)
  6302. if v, changed := fastpathTV.DecMapUintBytesV(*vp, true, d); changed {
  6303. *vp = v
  6304. }
  6305. } else {
  6306. fastpathTV.DecMapUintBytesV(rv2i(rv).(map[uint][]byte), false, d)
  6307. }
  6308. }
  6309. func (f fastpathT) DecMapUintBytesX(vp *map[uint][]byte, d *Decoder) {
  6310. if v, changed := f.DecMapUintBytesV(*vp, true, d); changed {
  6311. *vp = v
  6312. }
  6313. }
  6314. func (fastpathT) DecMapUintBytesV(v map[uint][]byte, canChange bool,
  6315. d *Decoder) (_ map[uint][]byte, changed bool) {
  6316. containerLen := d.mapStart()
  6317. if canChange && v == nil {
  6318. v = make(map[uint][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  6319. changed = true
  6320. }
  6321. if containerLen == 0 {
  6322. d.mapEnd()
  6323. return v, changed
  6324. }
  6325. mapGet := v != nil && !d.h.MapValueReset
  6326. var mk uint
  6327. var mv []byte
  6328. hasLen := containerLen > 0
  6329. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6330. d.mapElemKey()
  6331. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6332. d.mapElemValue()
  6333. if d.d.TryDecodeAsNil() {
  6334. if v == nil {
  6335. } else if d.h.DeleteOnNilMapValue {
  6336. delete(v, mk)
  6337. } else {
  6338. v[mk] = nil
  6339. }
  6340. continue
  6341. }
  6342. if mapGet {
  6343. mv = v[mk]
  6344. } else {
  6345. mv = nil
  6346. }
  6347. mv = d.d.DecodeBytes(mv, false)
  6348. if v != nil {
  6349. v[mk] = mv
  6350. }
  6351. }
  6352. d.mapEnd()
  6353. return v, changed
  6354. }
  6355. func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  6356. if rv.Kind() == reflect.Ptr {
  6357. vp := rv2i(rv).(*map[uint]uint)
  6358. if v, changed := fastpathTV.DecMapUintUintV(*vp, true, d); changed {
  6359. *vp = v
  6360. }
  6361. } else {
  6362. fastpathTV.DecMapUintUintV(rv2i(rv).(map[uint]uint), false, d)
  6363. }
  6364. }
  6365. func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) {
  6366. if v, changed := f.DecMapUintUintV(*vp, true, d); changed {
  6367. *vp = v
  6368. }
  6369. }
  6370. func (fastpathT) DecMapUintUintV(v map[uint]uint, canChange bool,
  6371. d *Decoder) (_ map[uint]uint, changed bool) {
  6372. containerLen := d.mapStart()
  6373. if canChange && v == nil {
  6374. v = make(map[uint]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6375. changed = true
  6376. }
  6377. if containerLen == 0 {
  6378. d.mapEnd()
  6379. return v, changed
  6380. }
  6381. var mk uint
  6382. var mv uint
  6383. hasLen := containerLen > 0
  6384. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6385. d.mapElemKey()
  6386. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6387. d.mapElemValue()
  6388. if d.d.TryDecodeAsNil() {
  6389. if v == nil {
  6390. } else if d.h.DeleteOnNilMapValue {
  6391. delete(v, mk)
  6392. } else {
  6393. v[mk] = 0
  6394. }
  6395. continue
  6396. }
  6397. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6398. if v != nil {
  6399. v[mk] = mv
  6400. }
  6401. }
  6402. d.mapEnd()
  6403. return v, changed
  6404. }
  6405. func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  6406. if rv.Kind() == reflect.Ptr {
  6407. vp := rv2i(rv).(*map[uint]uint8)
  6408. if v, changed := fastpathTV.DecMapUintUint8V(*vp, true, d); changed {
  6409. *vp = v
  6410. }
  6411. } else {
  6412. fastpathTV.DecMapUintUint8V(rv2i(rv).(map[uint]uint8), false, d)
  6413. }
  6414. }
  6415. func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) {
  6416. if v, changed := f.DecMapUintUint8V(*vp, true, d); changed {
  6417. *vp = v
  6418. }
  6419. }
  6420. func (fastpathT) DecMapUintUint8V(v map[uint]uint8, canChange bool,
  6421. d *Decoder) (_ map[uint]uint8, changed bool) {
  6422. containerLen := d.mapStart()
  6423. if canChange && v == nil {
  6424. v = make(map[uint]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6425. changed = true
  6426. }
  6427. if containerLen == 0 {
  6428. d.mapEnd()
  6429. return v, changed
  6430. }
  6431. var mk uint
  6432. var mv uint8
  6433. hasLen := containerLen > 0
  6434. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6435. d.mapElemKey()
  6436. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6437. d.mapElemValue()
  6438. if d.d.TryDecodeAsNil() {
  6439. if v == nil {
  6440. } else if d.h.DeleteOnNilMapValue {
  6441. delete(v, mk)
  6442. } else {
  6443. v[mk] = 0
  6444. }
  6445. continue
  6446. }
  6447. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6448. if v != nil {
  6449. v[mk] = mv
  6450. }
  6451. }
  6452. d.mapEnd()
  6453. return v, changed
  6454. }
  6455. func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  6456. if rv.Kind() == reflect.Ptr {
  6457. vp := rv2i(rv).(*map[uint]uint64)
  6458. if v, changed := fastpathTV.DecMapUintUint64V(*vp, true, d); changed {
  6459. *vp = v
  6460. }
  6461. } else {
  6462. fastpathTV.DecMapUintUint64V(rv2i(rv).(map[uint]uint64), false, d)
  6463. }
  6464. }
  6465. func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) {
  6466. if v, changed := f.DecMapUintUint64V(*vp, true, d); changed {
  6467. *vp = v
  6468. }
  6469. }
  6470. func (fastpathT) DecMapUintUint64V(v map[uint]uint64, canChange bool,
  6471. d *Decoder) (_ map[uint]uint64, changed bool) {
  6472. containerLen := d.mapStart()
  6473. if canChange && v == nil {
  6474. v = make(map[uint]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6475. changed = true
  6476. }
  6477. if containerLen == 0 {
  6478. d.mapEnd()
  6479. return v, changed
  6480. }
  6481. var mk uint
  6482. var mv uint64
  6483. hasLen := containerLen > 0
  6484. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6485. d.mapElemKey()
  6486. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6487. d.mapElemValue()
  6488. if d.d.TryDecodeAsNil() {
  6489. if v == nil {
  6490. } else if d.h.DeleteOnNilMapValue {
  6491. delete(v, mk)
  6492. } else {
  6493. v[mk] = 0
  6494. }
  6495. continue
  6496. }
  6497. mv = d.d.DecodeUint64()
  6498. if v != nil {
  6499. v[mk] = mv
  6500. }
  6501. }
  6502. d.mapEnd()
  6503. return v, changed
  6504. }
  6505. func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  6506. if rv.Kind() == reflect.Ptr {
  6507. vp := rv2i(rv).(*map[uint]int)
  6508. if v, changed := fastpathTV.DecMapUintIntV(*vp, true, d); changed {
  6509. *vp = v
  6510. }
  6511. } else {
  6512. fastpathTV.DecMapUintIntV(rv2i(rv).(map[uint]int), false, d)
  6513. }
  6514. }
  6515. func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) {
  6516. if v, changed := f.DecMapUintIntV(*vp, true, d); changed {
  6517. *vp = v
  6518. }
  6519. }
  6520. func (fastpathT) DecMapUintIntV(v map[uint]int, canChange bool,
  6521. d *Decoder) (_ map[uint]int, changed bool) {
  6522. containerLen := d.mapStart()
  6523. if canChange && v == nil {
  6524. v = make(map[uint]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6525. changed = true
  6526. }
  6527. if containerLen == 0 {
  6528. d.mapEnd()
  6529. return v, changed
  6530. }
  6531. var mk uint
  6532. var mv int
  6533. hasLen := containerLen > 0
  6534. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6535. d.mapElemKey()
  6536. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6537. d.mapElemValue()
  6538. if d.d.TryDecodeAsNil() {
  6539. if v == nil {
  6540. } else if d.h.DeleteOnNilMapValue {
  6541. delete(v, mk)
  6542. } else {
  6543. v[mk] = 0
  6544. }
  6545. continue
  6546. }
  6547. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  6548. if v != nil {
  6549. v[mk] = mv
  6550. }
  6551. }
  6552. d.mapEnd()
  6553. return v, changed
  6554. }
  6555. func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  6556. if rv.Kind() == reflect.Ptr {
  6557. vp := rv2i(rv).(*map[uint]int64)
  6558. if v, changed := fastpathTV.DecMapUintInt64V(*vp, true, d); changed {
  6559. *vp = v
  6560. }
  6561. } else {
  6562. fastpathTV.DecMapUintInt64V(rv2i(rv).(map[uint]int64), false, d)
  6563. }
  6564. }
  6565. func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) {
  6566. if v, changed := f.DecMapUintInt64V(*vp, true, d); changed {
  6567. *vp = v
  6568. }
  6569. }
  6570. func (fastpathT) DecMapUintInt64V(v map[uint]int64, canChange bool,
  6571. d *Decoder) (_ map[uint]int64, changed bool) {
  6572. containerLen := d.mapStart()
  6573. if canChange && v == nil {
  6574. v = make(map[uint]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6575. changed = true
  6576. }
  6577. if containerLen == 0 {
  6578. d.mapEnd()
  6579. return v, changed
  6580. }
  6581. var mk uint
  6582. var mv int64
  6583. hasLen := containerLen > 0
  6584. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6585. d.mapElemKey()
  6586. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6587. d.mapElemValue()
  6588. if d.d.TryDecodeAsNil() {
  6589. if v == nil {
  6590. } else if d.h.DeleteOnNilMapValue {
  6591. delete(v, mk)
  6592. } else {
  6593. v[mk] = 0
  6594. }
  6595. continue
  6596. }
  6597. mv = d.d.DecodeInt64()
  6598. if v != nil {
  6599. v[mk] = mv
  6600. }
  6601. }
  6602. d.mapEnd()
  6603. return v, changed
  6604. }
  6605. func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  6606. if rv.Kind() == reflect.Ptr {
  6607. vp := rv2i(rv).(*map[uint]float32)
  6608. if v, changed := fastpathTV.DecMapUintFloat32V(*vp, true, d); changed {
  6609. *vp = v
  6610. }
  6611. } else {
  6612. fastpathTV.DecMapUintFloat32V(rv2i(rv).(map[uint]float32), false, d)
  6613. }
  6614. }
  6615. func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) {
  6616. if v, changed := f.DecMapUintFloat32V(*vp, true, d); changed {
  6617. *vp = v
  6618. }
  6619. }
  6620. func (fastpathT) DecMapUintFloat32V(v map[uint]float32, canChange bool,
  6621. d *Decoder) (_ map[uint]float32, changed bool) {
  6622. containerLen := d.mapStart()
  6623. if canChange && v == nil {
  6624. v = make(map[uint]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  6625. changed = true
  6626. }
  6627. if containerLen == 0 {
  6628. d.mapEnd()
  6629. return v, changed
  6630. }
  6631. var mk uint
  6632. var mv float32
  6633. hasLen := containerLen > 0
  6634. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6635. d.mapElemKey()
  6636. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6637. d.mapElemValue()
  6638. if d.d.TryDecodeAsNil() {
  6639. if v == nil {
  6640. } else if d.h.DeleteOnNilMapValue {
  6641. delete(v, mk)
  6642. } else {
  6643. v[mk] = 0
  6644. }
  6645. continue
  6646. }
  6647. mv = float32(d.decodeFloat32())
  6648. if v != nil {
  6649. v[mk] = mv
  6650. }
  6651. }
  6652. d.mapEnd()
  6653. return v, changed
  6654. }
  6655. func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  6656. if rv.Kind() == reflect.Ptr {
  6657. vp := rv2i(rv).(*map[uint]float64)
  6658. if v, changed := fastpathTV.DecMapUintFloat64V(*vp, true, d); changed {
  6659. *vp = v
  6660. }
  6661. } else {
  6662. fastpathTV.DecMapUintFloat64V(rv2i(rv).(map[uint]float64), false, d)
  6663. }
  6664. }
  6665. func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) {
  6666. if v, changed := f.DecMapUintFloat64V(*vp, true, d); changed {
  6667. *vp = v
  6668. }
  6669. }
  6670. func (fastpathT) DecMapUintFloat64V(v map[uint]float64, canChange bool,
  6671. d *Decoder) (_ map[uint]float64, changed bool) {
  6672. containerLen := d.mapStart()
  6673. if canChange && v == nil {
  6674. v = make(map[uint]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6675. changed = true
  6676. }
  6677. if containerLen == 0 {
  6678. d.mapEnd()
  6679. return v, changed
  6680. }
  6681. var mk uint
  6682. var mv float64
  6683. hasLen := containerLen > 0
  6684. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6685. d.mapElemKey()
  6686. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6687. d.mapElemValue()
  6688. if d.d.TryDecodeAsNil() {
  6689. if v == nil {
  6690. } else if d.h.DeleteOnNilMapValue {
  6691. delete(v, mk)
  6692. } else {
  6693. v[mk] = 0
  6694. }
  6695. continue
  6696. }
  6697. mv = d.d.DecodeFloat64()
  6698. if v != nil {
  6699. v[mk] = mv
  6700. }
  6701. }
  6702. d.mapEnd()
  6703. return v, changed
  6704. }
  6705. func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  6706. if rv.Kind() == reflect.Ptr {
  6707. vp := rv2i(rv).(*map[uint]bool)
  6708. if v, changed := fastpathTV.DecMapUintBoolV(*vp, true, d); changed {
  6709. *vp = v
  6710. }
  6711. } else {
  6712. fastpathTV.DecMapUintBoolV(rv2i(rv).(map[uint]bool), false, d)
  6713. }
  6714. }
  6715. func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) {
  6716. if v, changed := f.DecMapUintBoolV(*vp, true, d); changed {
  6717. *vp = v
  6718. }
  6719. }
  6720. func (fastpathT) DecMapUintBoolV(v map[uint]bool, canChange bool,
  6721. d *Decoder) (_ map[uint]bool, changed bool) {
  6722. containerLen := d.mapStart()
  6723. if canChange && v == nil {
  6724. v = make(map[uint]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6725. changed = true
  6726. }
  6727. if containerLen == 0 {
  6728. d.mapEnd()
  6729. return v, changed
  6730. }
  6731. var mk uint
  6732. var mv bool
  6733. hasLen := containerLen > 0
  6734. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6735. d.mapElemKey()
  6736. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6737. d.mapElemValue()
  6738. if d.d.TryDecodeAsNil() {
  6739. if v == nil {
  6740. } else if d.h.DeleteOnNilMapValue {
  6741. delete(v, mk)
  6742. } else {
  6743. v[mk] = false
  6744. }
  6745. continue
  6746. }
  6747. mv = d.d.DecodeBool()
  6748. if v != nil {
  6749. v[mk] = mv
  6750. }
  6751. }
  6752. d.mapEnd()
  6753. return v, changed
  6754. }
  6755. func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  6756. if rv.Kind() == reflect.Ptr {
  6757. vp := rv2i(rv).(*map[uint8]interface{})
  6758. if v, changed := fastpathTV.DecMapUint8IntfV(*vp, true, d); changed {
  6759. *vp = v
  6760. }
  6761. } else {
  6762. fastpathTV.DecMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), false, d)
  6763. }
  6764. }
  6765. func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
  6766. if v, changed := f.DecMapUint8IntfV(*vp, true, d); changed {
  6767. *vp = v
  6768. }
  6769. }
  6770. func (fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, canChange bool,
  6771. d *Decoder) (_ map[uint8]interface{}, changed bool) {
  6772. containerLen := d.mapStart()
  6773. if canChange && v == nil {
  6774. v = make(map[uint8]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6775. changed = true
  6776. }
  6777. if containerLen == 0 {
  6778. d.mapEnd()
  6779. return v, changed
  6780. }
  6781. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  6782. var mk uint8
  6783. var mv interface{}
  6784. hasLen := containerLen > 0
  6785. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6786. d.mapElemKey()
  6787. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6788. d.mapElemValue()
  6789. if d.d.TryDecodeAsNil() {
  6790. if v == nil {
  6791. } else if d.h.DeleteOnNilMapValue {
  6792. delete(v, mk)
  6793. } else {
  6794. v[mk] = nil
  6795. }
  6796. continue
  6797. }
  6798. if mapGet {
  6799. mv = v[mk]
  6800. } else {
  6801. mv = nil
  6802. }
  6803. d.decode(&mv)
  6804. if v != nil {
  6805. v[mk] = mv
  6806. }
  6807. }
  6808. d.mapEnd()
  6809. return v, changed
  6810. }
  6811. func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  6812. if rv.Kind() == reflect.Ptr {
  6813. vp := rv2i(rv).(*map[uint8]string)
  6814. if v, changed := fastpathTV.DecMapUint8StringV(*vp, true, d); changed {
  6815. *vp = v
  6816. }
  6817. } else {
  6818. fastpathTV.DecMapUint8StringV(rv2i(rv).(map[uint8]string), false, d)
  6819. }
  6820. }
  6821. func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
  6822. if v, changed := f.DecMapUint8StringV(*vp, true, d); changed {
  6823. *vp = v
  6824. }
  6825. }
  6826. func (fastpathT) DecMapUint8StringV(v map[uint8]string, canChange bool,
  6827. d *Decoder) (_ map[uint8]string, changed bool) {
  6828. containerLen := d.mapStart()
  6829. if canChange && v == nil {
  6830. v = make(map[uint8]string, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6831. changed = true
  6832. }
  6833. if containerLen == 0 {
  6834. d.mapEnd()
  6835. return v, changed
  6836. }
  6837. var mk uint8
  6838. var mv string
  6839. hasLen := containerLen > 0
  6840. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6841. d.mapElemKey()
  6842. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6843. d.mapElemValue()
  6844. if d.d.TryDecodeAsNil() {
  6845. if v == nil {
  6846. } else if d.h.DeleteOnNilMapValue {
  6847. delete(v, mk)
  6848. } else {
  6849. v[mk] = ""
  6850. }
  6851. continue
  6852. }
  6853. mv = d.d.DecodeString()
  6854. if v != nil {
  6855. v[mk] = mv
  6856. }
  6857. }
  6858. d.mapEnd()
  6859. return v, changed
  6860. }
  6861. func (d *Decoder) fastpathDecMapUint8BytesR(f *codecFnInfo, rv reflect.Value) {
  6862. if rv.Kind() == reflect.Ptr {
  6863. vp := rv2i(rv).(*map[uint8][]byte)
  6864. if v, changed := fastpathTV.DecMapUint8BytesV(*vp, true, d); changed {
  6865. *vp = v
  6866. }
  6867. } else {
  6868. fastpathTV.DecMapUint8BytesV(rv2i(rv).(map[uint8][]byte), false, d)
  6869. }
  6870. }
  6871. func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) {
  6872. if v, changed := f.DecMapUint8BytesV(*vp, true, d); changed {
  6873. *vp = v
  6874. }
  6875. }
  6876. func (fastpathT) DecMapUint8BytesV(v map[uint8][]byte, canChange bool,
  6877. d *Decoder) (_ map[uint8][]byte, changed bool) {
  6878. containerLen := d.mapStart()
  6879. if canChange && v == nil {
  6880. v = make(map[uint8][]byte, decInferLen(containerLen, d.h.MaxInitLen, 25))
  6881. changed = true
  6882. }
  6883. if containerLen == 0 {
  6884. d.mapEnd()
  6885. return v, changed
  6886. }
  6887. mapGet := v != nil && !d.h.MapValueReset
  6888. var mk uint8
  6889. var mv []byte
  6890. hasLen := containerLen > 0
  6891. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6892. d.mapElemKey()
  6893. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6894. d.mapElemValue()
  6895. if d.d.TryDecodeAsNil() {
  6896. if v == nil {
  6897. } else if d.h.DeleteOnNilMapValue {
  6898. delete(v, mk)
  6899. } else {
  6900. v[mk] = nil
  6901. }
  6902. continue
  6903. }
  6904. if mapGet {
  6905. mv = v[mk]
  6906. } else {
  6907. mv = nil
  6908. }
  6909. mv = d.d.DecodeBytes(mv, false)
  6910. if v != nil {
  6911. v[mk] = mv
  6912. }
  6913. }
  6914. d.mapEnd()
  6915. return v, changed
  6916. }
  6917. func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  6918. if rv.Kind() == reflect.Ptr {
  6919. vp := rv2i(rv).(*map[uint8]uint)
  6920. if v, changed := fastpathTV.DecMapUint8UintV(*vp, true, d); changed {
  6921. *vp = v
  6922. }
  6923. } else {
  6924. fastpathTV.DecMapUint8UintV(rv2i(rv).(map[uint8]uint), false, d)
  6925. }
  6926. }
  6927. func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) {
  6928. if v, changed := f.DecMapUint8UintV(*vp, true, d); changed {
  6929. *vp = v
  6930. }
  6931. }
  6932. func (fastpathT) DecMapUint8UintV(v map[uint8]uint, canChange bool,
  6933. d *Decoder) (_ map[uint8]uint, changed bool) {
  6934. containerLen := d.mapStart()
  6935. if canChange && v == nil {
  6936. v = make(map[uint8]uint, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6937. changed = true
  6938. }
  6939. if containerLen == 0 {
  6940. d.mapEnd()
  6941. return v, changed
  6942. }
  6943. var mk uint8
  6944. var mv uint
  6945. hasLen := containerLen > 0
  6946. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6947. d.mapElemKey()
  6948. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6949. d.mapElemValue()
  6950. if d.d.TryDecodeAsNil() {
  6951. if v == nil {
  6952. } else if d.h.DeleteOnNilMapValue {
  6953. delete(v, mk)
  6954. } else {
  6955. v[mk] = 0
  6956. }
  6957. continue
  6958. }
  6959. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6960. if v != nil {
  6961. v[mk] = mv
  6962. }
  6963. }
  6964. d.mapEnd()
  6965. return v, changed
  6966. }
  6967. func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  6968. if rv.Kind() == reflect.Ptr {
  6969. vp := rv2i(rv).(*map[uint8]uint8)
  6970. if v, changed := fastpathTV.DecMapUint8Uint8V(*vp, true, d); changed {
  6971. *vp = v
  6972. }
  6973. } else {
  6974. fastpathTV.DecMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), false, d)
  6975. }
  6976. }
  6977. func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
  6978. if v, changed := f.DecMapUint8Uint8V(*vp, true, d); changed {
  6979. *vp = v
  6980. }
  6981. }
  6982. func (fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, canChange bool,
  6983. d *Decoder) (_ map[uint8]uint8, changed bool) {
  6984. containerLen := d.mapStart()
  6985. if canChange && v == nil {
  6986. v = make(map[uint8]uint8, decInferLen(containerLen, d.h.MaxInitLen, 2))
  6987. changed = true
  6988. }
  6989. if containerLen == 0 {
  6990. d.mapEnd()
  6991. return v, changed
  6992. }
  6993. var mk uint8
  6994. var mv uint8
  6995. hasLen := containerLen > 0
  6996. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6997. d.mapElemKey()
  6998. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6999. d.mapElemValue()
  7000. if d.d.TryDecodeAsNil() {
  7001. if v == nil {
  7002. } else if d.h.DeleteOnNilMapValue {
  7003. delete(v, mk)
  7004. } else {
  7005. v[mk] = 0
  7006. }
  7007. continue
  7008. }
  7009. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7010. if v != nil {
  7011. v[mk] = mv
  7012. }
  7013. }
  7014. d.mapEnd()
  7015. return v, changed
  7016. }
  7017. func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  7018. if rv.Kind() == reflect.Ptr {
  7019. vp := rv2i(rv).(*map[uint8]uint64)
  7020. if v, changed := fastpathTV.DecMapUint8Uint64V(*vp, true, d); changed {
  7021. *vp = v
  7022. }
  7023. } else {
  7024. fastpathTV.DecMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), false, d)
  7025. }
  7026. }
  7027. func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
  7028. if v, changed := f.DecMapUint8Uint64V(*vp, true, d); changed {
  7029. *vp = v
  7030. }
  7031. }
  7032. func (fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, canChange bool,
  7033. d *Decoder) (_ map[uint8]uint64, changed bool) {
  7034. containerLen := d.mapStart()
  7035. if canChange && v == nil {
  7036. v = make(map[uint8]uint64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7037. changed = true
  7038. }
  7039. if containerLen == 0 {
  7040. d.mapEnd()
  7041. return v, changed
  7042. }
  7043. var mk uint8
  7044. var mv uint64
  7045. hasLen := containerLen > 0
  7046. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7047. d.mapElemKey()
  7048. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7049. d.mapElemValue()
  7050. if d.d.TryDecodeAsNil() {
  7051. if v == nil {
  7052. } else if d.h.DeleteOnNilMapValue {
  7053. delete(v, mk)
  7054. } else {
  7055. v[mk] = 0
  7056. }
  7057. continue
  7058. }
  7059. mv = d.d.DecodeUint64()
  7060. if v != nil {
  7061. v[mk] = mv
  7062. }
  7063. }
  7064. d.mapEnd()
  7065. return v, changed
  7066. }
  7067. func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  7068. if rv.Kind() == reflect.Ptr {
  7069. vp := rv2i(rv).(*map[uint8]int)
  7070. if v, changed := fastpathTV.DecMapUint8IntV(*vp, true, d); changed {
  7071. *vp = v
  7072. }
  7073. } else {
  7074. fastpathTV.DecMapUint8IntV(rv2i(rv).(map[uint8]int), false, d)
  7075. }
  7076. }
  7077. func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
  7078. if v, changed := f.DecMapUint8IntV(*vp, true, d); changed {
  7079. *vp = v
  7080. }
  7081. }
  7082. func (fastpathT) DecMapUint8IntV(v map[uint8]int, canChange bool,
  7083. d *Decoder) (_ map[uint8]int, changed bool) {
  7084. containerLen := d.mapStart()
  7085. if canChange && v == nil {
  7086. v = make(map[uint8]int, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7087. changed = true
  7088. }
  7089. if containerLen == 0 {
  7090. d.mapEnd()
  7091. return v, changed
  7092. }
  7093. var mk uint8
  7094. var mv int
  7095. hasLen := containerLen > 0
  7096. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7097. d.mapElemKey()
  7098. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7099. d.mapElemValue()
  7100. if d.d.TryDecodeAsNil() {
  7101. if v == nil {
  7102. } else if d.h.DeleteOnNilMapValue {
  7103. delete(v, mk)
  7104. } else {
  7105. v[mk] = 0
  7106. }
  7107. continue
  7108. }
  7109. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7110. if v != nil {
  7111. v[mk] = mv
  7112. }
  7113. }
  7114. d.mapEnd()
  7115. return v, changed
  7116. }
  7117. func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  7118. if rv.Kind() == reflect.Ptr {
  7119. vp := rv2i(rv).(*map[uint8]int64)
  7120. if v, changed := fastpathTV.DecMapUint8Int64V(*vp, true, d); changed {
  7121. *vp = v
  7122. }
  7123. } else {
  7124. fastpathTV.DecMapUint8Int64V(rv2i(rv).(map[uint8]int64), false, d)
  7125. }
  7126. }
  7127. func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) {
  7128. if v, changed := f.DecMapUint8Int64V(*vp, true, d); changed {
  7129. *vp = v
  7130. }
  7131. }
  7132. func (fastpathT) DecMapUint8Int64V(v map[uint8]int64, canChange bool,
  7133. d *Decoder) (_ map[uint8]int64, changed bool) {
  7134. containerLen := d.mapStart()
  7135. if canChange && v == nil {
  7136. v = make(map[uint8]int64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7137. changed = true
  7138. }
  7139. if containerLen == 0 {
  7140. d.mapEnd()
  7141. return v, changed
  7142. }
  7143. var mk uint8
  7144. var mv int64
  7145. hasLen := containerLen > 0
  7146. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7147. d.mapElemKey()
  7148. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7149. d.mapElemValue()
  7150. if d.d.TryDecodeAsNil() {
  7151. if v == nil {
  7152. } else if d.h.DeleteOnNilMapValue {
  7153. delete(v, mk)
  7154. } else {
  7155. v[mk] = 0
  7156. }
  7157. continue
  7158. }
  7159. mv = d.d.DecodeInt64()
  7160. if v != nil {
  7161. v[mk] = mv
  7162. }
  7163. }
  7164. d.mapEnd()
  7165. return v, changed
  7166. }
  7167. func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  7168. if rv.Kind() == reflect.Ptr {
  7169. vp := rv2i(rv).(*map[uint8]float32)
  7170. if v, changed := fastpathTV.DecMapUint8Float32V(*vp, true, d); changed {
  7171. *vp = v
  7172. }
  7173. } else {
  7174. fastpathTV.DecMapUint8Float32V(rv2i(rv).(map[uint8]float32), false, d)
  7175. }
  7176. }
  7177. func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) {
  7178. if v, changed := f.DecMapUint8Float32V(*vp, true, d); changed {
  7179. *vp = v
  7180. }
  7181. }
  7182. func (fastpathT) DecMapUint8Float32V(v map[uint8]float32, canChange bool,
  7183. d *Decoder) (_ map[uint8]float32, changed bool) {
  7184. containerLen := d.mapStart()
  7185. if canChange && v == nil {
  7186. v = make(map[uint8]float32, decInferLen(containerLen, d.h.MaxInitLen, 5))
  7187. changed = true
  7188. }
  7189. if containerLen == 0 {
  7190. d.mapEnd()
  7191. return v, changed
  7192. }
  7193. var mk uint8
  7194. var mv float32
  7195. hasLen := containerLen > 0
  7196. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7197. d.mapElemKey()
  7198. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7199. d.mapElemValue()
  7200. if d.d.TryDecodeAsNil() {
  7201. if v == nil {
  7202. } else if d.h.DeleteOnNilMapValue {
  7203. delete(v, mk)
  7204. } else {
  7205. v[mk] = 0
  7206. }
  7207. continue
  7208. }
  7209. mv = float32(d.decodeFloat32())
  7210. if v != nil {
  7211. v[mk] = mv
  7212. }
  7213. }
  7214. d.mapEnd()
  7215. return v, changed
  7216. }
  7217. func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  7218. if rv.Kind() == reflect.Ptr {
  7219. vp := rv2i(rv).(*map[uint8]float64)
  7220. if v, changed := fastpathTV.DecMapUint8Float64V(*vp, true, d); changed {
  7221. *vp = v
  7222. }
  7223. } else {
  7224. fastpathTV.DecMapUint8Float64V(rv2i(rv).(map[uint8]float64), false, d)
  7225. }
  7226. }
  7227. func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
  7228. if v, changed := f.DecMapUint8Float64V(*vp, true, d); changed {
  7229. *vp = v
  7230. }
  7231. }
  7232. func (fastpathT) DecMapUint8Float64V(v map[uint8]float64, canChange bool,
  7233. d *Decoder) (_ map[uint8]float64, changed bool) {
  7234. containerLen := d.mapStart()
  7235. if canChange && v == nil {
  7236. v = make(map[uint8]float64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7237. changed = true
  7238. }
  7239. if containerLen == 0 {
  7240. d.mapEnd()
  7241. return v, changed
  7242. }
  7243. var mk uint8
  7244. var mv float64
  7245. hasLen := containerLen > 0
  7246. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7247. d.mapElemKey()
  7248. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7249. d.mapElemValue()
  7250. if d.d.TryDecodeAsNil() {
  7251. if v == nil {
  7252. } else if d.h.DeleteOnNilMapValue {
  7253. delete(v, mk)
  7254. } else {
  7255. v[mk] = 0
  7256. }
  7257. continue
  7258. }
  7259. mv = d.d.DecodeFloat64()
  7260. if v != nil {
  7261. v[mk] = mv
  7262. }
  7263. }
  7264. d.mapEnd()
  7265. return v, changed
  7266. }
  7267. func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  7268. if rv.Kind() == reflect.Ptr {
  7269. vp := rv2i(rv).(*map[uint8]bool)
  7270. if v, changed := fastpathTV.DecMapUint8BoolV(*vp, true, d); changed {
  7271. *vp = v
  7272. }
  7273. } else {
  7274. fastpathTV.DecMapUint8BoolV(rv2i(rv).(map[uint8]bool), false, d)
  7275. }
  7276. }
  7277. func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
  7278. if v, changed := f.DecMapUint8BoolV(*vp, true, d); changed {
  7279. *vp = v
  7280. }
  7281. }
  7282. func (fastpathT) DecMapUint8BoolV(v map[uint8]bool, canChange bool,
  7283. d *Decoder) (_ map[uint8]bool, changed bool) {
  7284. containerLen := d.mapStart()
  7285. if canChange && v == nil {
  7286. v = make(map[uint8]bool, decInferLen(containerLen, d.h.MaxInitLen, 2))
  7287. changed = true
  7288. }
  7289. if containerLen == 0 {
  7290. d.mapEnd()
  7291. return v, changed
  7292. }
  7293. var mk uint8
  7294. var mv bool
  7295. hasLen := containerLen > 0
  7296. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7297. d.mapElemKey()
  7298. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7299. d.mapElemValue()
  7300. if d.d.TryDecodeAsNil() {
  7301. if v == nil {
  7302. } else if d.h.DeleteOnNilMapValue {
  7303. delete(v, mk)
  7304. } else {
  7305. v[mk] = false
  7306. }
  7307. continue
  7308. }
  7309. mv = d.d.DecodeBool()
  7310. if v != nil {
  7311. v[mk] = mv
  7312. }
  7313. }
  7314. d.mapEnd()
  7315. return v, changed
  7316. }
  7317. func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  7318. if rv.Kind() == reflect.Ptr {
  7319. vp := rv2i(rv).(*map[uint64]interface{})
  7320. if v, changed := fastpathTV.DecMapUint64IntfV(*vp, true, d); changed {
  7321. *vp = v
  7322. }
  7323. } else {
  7324. fastpathTV.DecMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), false, d)
  7325. }
  7326. }
  7327. func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
  7328. if v, changed := f.DecMapUint64IntfV(*vp, true, d); changed {
  7329. *vp = v
  7330. }
  7331. }
  7332. func (fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, canChange bool,
  7333. d *Decoder) (_ map[uint64]interface{}, changed bool) {
  7334. containerLen := d.mapStart()
  7335. if canChange && v == nil {
  7336. v = make(map[uint64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7337. changed = true
  7338. }
  7339. if containerLen == 0 {
  7340. d.mapEnd()
  7341. return v, changed
  7342. }
  7343. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7344. var mk uint64
  7345. var mv interface{}
  7346. hasLen := containerLen > 0
  7347. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7348. d.mapElemKey()
  7349. mk = d.d.DecodeUint64()
  7350. d.mapElemValue()
  7351. if d.d.TryDecodeAsNil() {
  7352. if v == nil {
  7353. } else if d.h.DeleteOnNilMapValue {
  7354. delete(v, mk)
  7355. } else {
  7356. v[mk] = nil
  7357. }
  7358. continue
  7359. }
  7360. if mapGet {
  7361. mv = v[mk]
  7362. } else {
  7363. mv = nil
  7364. }
  7365. d.decode(&mv)
  7366. if v != nil {
  7367. v[mk] = mv
  7368. }
  7369. }
  7370. d.mapEnd()
  7371. return v, changed
  7372. }
  7373. func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  7374. if rv.Kind() == reflect.Ptr {
  7375. vp := rv2i(rv).(*map[uint64]string)
  7376. if v, changed := fastpathTV.DecMapUint64StringV(*vp, true, d); changed {
  7377. *vp = v
  7378. }
  7379. } else {
  7380. fastpathTV.DecMapUint64StringV(rv2i(rv).(map[uint64]string), false, d)
  7381. }
  7382. }
  7383. func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
  7384. if v, changed := f.DecMapUint64StringV(*vp, true, d); changed {
  7385. *vp = v
  7386. }
  7387. }
  7388. func (fastpathT) DecMapUint64StringV(v map[uint64]string, canChange bool,
  7389. d *Decoder) (_ map[uint64]string, changed bool) {
  7390. containerLen := d.mapStart()
  7391. if canChange && v == nil {
  7392. v = make(map[uint64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7393. changed = true
  7394. }
  7395. if containerLen == 0 {
  7396. d.mapEnd()
  7397. return v, changed
  7398. }
  7399. var mk uint64
  7400. var mv string
  7401. hasLen := containerLen > 0
  7402. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7403. d.mapElemKey()
  7404. mk = d.d.DecodeUint64()
  7405. d.mapElemValue()
  7406. if d.d.TryDecodeAsNil() {
  7407. if v == nil {
  7408. } else if d.h.DeleteOnNilMapValue {
  7409. delete(v, mk)
  7410. } else {
  7411. v[mk] = ""
  7412. }
  7413. continue
  7414. }
  7415. mv = d.d.DecodeString()
  7416. if v != nil {
  7417. v[mk] = mv
  7418. }
  7419. }
  7420. d.mapEnd()
  7421. return v, changed
  7422. }
  7423. func (d *Decoder) fastpathDecMapUint64BytesR(f *codecFnInfo, rv reflect.Value) {
  7424. if rv.Kind() == reflect.Ptr {
  7425. vp := rv2i(rv).(*map[uint64][]byte)
  7426. if v, changed := fastpathTV.DecMapUint64BytesV(*vp, true, d); changed {
  7427. *vp = v
  7428. }
  7429. } else {
  7430. fastpathTV.DecMapUint64BytesV(rv2i(rv).(map[uint64][]byte), false, d)
  7431. }
  7432. }
  7433. func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) {
  7434. if v, changed := f.DecMapUint64BytesV(*vp, true, d); changed {
  7435. *vp = v
  7436. }
  7437. }
  7438. func (fastpathT) DecMapUint64BytesV(v map[uint64][]byte, canChange bool,
  7439. d *Decoder) (_ map[uint64][]byte, changed bool) {
  7440. containerLen := d.mapStart()
  7441. if canChange && v == nil {
  7442. v = make(map[uint64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  7443. changed = true
  7444. }
  7445. if containerLen == 0 {
  7446. d.mapEnd()
  7447. return v, changed
  7448. }
  7449. mapGet := v != nil && !d.h.MapValueReset
  7450. var mk uint64
  7451. var mv []byte
  7452. hasLen := containerLen > 0
  7453. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7454. d.mapElemKey()
  7455. mk = d.d.DecodeUint64()
  7456. d.mapElemValue()
  7457. if d.d.TryDecodeAsNil() {
  7458. if v == nil {
  7459. } else if d.h.DeleteOnNilMapValue {
  7460. delete(v, mk)
  7461. } else {
  7462. v[mk] = nil
  7463. }
  7464. continue
  7465. }
  7466. if mapGet {
  7467. mv = v[mk]
  7468. } else {
  7469. mv = nil
  7470. }
  7471. mv = d.d.DecodeBytes(mv, false)
  7472. if v != nil {
  7473. v[mk] = mv
  7474. }
  7475. }
  7476. d.mapEnd()
  7477. return v, changed
  7478. }
  7479. func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  7480. if rv.Kind() == reflect.Ptr {
  7481. vp := rv2i(rv).(*map[uint64]uint)
  7482. if v, changed := fastpathTV.DecMapUint64UintV(*vp, true, d); changed {
  7483. *vp = v
  7484. }
  7485. } else {
  7486. fastpathTV.DecMapUint64UintV(rv2i(rv).(map[uint64]uint), false, d)
  7487. }
  7488. }
  7489. func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) {
  7490. if v, changed := f.DecMapUint64UintV(*vp, true, d); changed {
  7491. *vp = v
  7492. }
  7493. }
  7494. func (fastpathT) DecMapUint64UintV(v map[uint64]uint, canChange bool,
  7495. d *Decoder) (_ map[uint64]uint, changed bool) {
  7496. containerLen := d.mapStart()
  7497. if canChange && v == nil {
  7498. v = make(map[uint64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7499. changed = true
  7500. }
  7501. if containerLen == 0 {
  7502. d.mapEnd()
  7503. return v, changed
  7504. }
  7505. var mk uint64
  7506. var mv uint
  7507. hasLen := containerLen > 0
  7508. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7509. d.mapElemKey()
  7510. mk = d.d.DecodeUint64()
  7511. d.mapElemValue()
  7512. if d.d.TryDecodeAsNil() {
  7513. if v == nil {
  7514. } else if d.h.DeleteOnNilMapValue {
  7515. delete(v, mk)
  7516. } else {
  7517. v[mk] = 0
  7518. }
  7519. continue
  7520. }
  7521. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7522. if v != nil {
  7523. v[mk] = mv
  7524. }
  7525. }
  7526. d.mapEnd()
  7527. return v, changed
  7528. }
  7529. func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  7530. if rv.Kind() == reflect.Ptr {
  7531. vp := rv2i(rv).(*map[uint64]uint8)
  7532. if v, changed := fastpathTV.DecMapUint64Uint8V(*vp, true, d); changed {
  7533. *vp = v
  7534. }
  7535. } else {
  7536. fastpathTV.DecMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), false, d)
  7537. }
  7538. }
  7539. func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
  7540. if v, changed := f.DecMapUint64Uint8V(*vp, true, d); changed {
  7541. *vp = v
  7542. }
  7543. }
  7544. func (fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, canChange bool,
  7545. d *Decoder) (_ map[uint64]uint8, changed bool) {
  7546. containerLen := d.mapStart()
  7547. if canChange && v == nil {
  7548. v = make(map[uint64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7549. changed = true
  7550. }
  7551. if containerLen == 0 {
  7552. d.mapEnd()
  7553. return v, changed
  7554. }
  7555. var mk uint64
  7556. var mv uint8
  7557. hasLen := containerLen > 0
  7558. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7559. d.mapElemKey()
  7560. mk = d.d.DecodeUint64()
  7561. d.mapElemValue()
  7562. if d.d.TryDecodeAsNil() {
  7563. if v == nil {
  7564. } else if d.h.DeleteOnNilMapValue {
  7565. delete(v, mk)
  7566. } else {
  7567. v[mk] = 0
  7568. }
  7569. continue
  7570. }
  7571. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7572. if v != nil {
  7573. v[mk] = mv
  7574. }
  7575. }
  7576. d.mapEnd()
  7577. return v, changed
  7578. }
  7579. func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  7580. if rv.Kind() == reflect.Ptr {
  7581. vp := rv2i(rv).(*map[uint64]uint64)
  7582. if v, changed := fastpathTV.DecMapUint64Uint64V(*vp, true, d); changed {
  7583. *vp = v
  7584. }
  7585. } else {
  7586. fastpathTV.DecMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), false, d)
  7587. }
  7588. }
  7589. func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
  7590. if v, changed := f.DecMapUint64Uint64V(*vp, true, d); changed {
  7591. *vp = v
  7592. }
  7593. }
  7594. func (fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, canChange bool,
  7595. d *Decoder) (_ map[uint64]uint64, changed bool) {
  7596. containerLen := d.mapStart()
  7597. if canChange && v == nil {
  7598. v = make(map[uint64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7599. changed = true
  7600. }
  7601. if containerLen == 0 {
  7602. d.mapEnd()
  7603. return v, changed
  7604. }
  7605. var mk uint64
  7606. var mv uint64
  7607. hasLen := containerLen > 0
  7608. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7609. d.mapElemKey()
  7610. mk = d.d.DecodeUint64()
  7611. d.mapElemValue()
  7612. if d.d.TryDecodeAsNil() {
  7613. if v == nil {
  7614. } else if d.h.DeleteOnNilMapValue {
  7615. delete(v, mk)
  7616. } else {
  7617. v[mk] = 0
  7618. }
  7619. continue
  7620. }
  7621. mv = d.d.DecodeUint64()
  7622. if v != nil {
  7623. v[mk] = mv
  7624. }
  7625. }
  7626. d.mapEnd()
  7627. return v, changed
  7628. }
  7629. func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  7630. if rv.Kind() == reflect.Ptr {
  7631. vp := rv2i(rv).(*map[uint64]int)
  7632. if v, changed := fastpathTV.DecMapUint64IntV(*vp, true, d); changed {
  7633. *vp = v
  7634. }
  7635. } else {
  7636. fastpathTV.DecMapUint64IntV(rv2i(rv).(map[uint64]int), false, d)
  7637. }
  7638. }
  7639. func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
  7640. if v, changed := f.DecMapUint64IntV(*vp, true, d); changed {
  7641. *vp = v
  7642. }
  7643. }
  7644. func (fastpathT) DecMapUint64IntV(v map[uint64]int, canChange bool,
  7645. d *Decoder) (_ map[uint64]int, changed bool) {
  7646. containerLen := d.mapStart()
  7647. if canChange && v == nil {
  7648. v = make(map[uint64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7649. changed = true
  7650. }
  7651. if containerLen == 0 {
  7652. d.mapEnd()
  7653. return v, changed
  7654. }
  7655. var mk uint64
  7656. var mv int
  7657. hasLen := containerLen > 0
  7658. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7659. d.mapElemKey()
  7660. mk = d.d.DecodeUint64()
  7661. d.mapElemValue()
  7662. if d.d.TryDecodeAsNil() {
  7663. if v == nil {
  7664. } else if d.h.DeleteOnNilMapValue {
  7665. delete(v, mk)
  7666. } else {
  7667. v[mk] = 0
  7668. }
  7669. continue
  7670. }
  7671. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7672. if v != nil {
  7673. v[mk] = mv
  7674. }
  7675. }
  7676. d.mapEnd()
  7677. return v, changed
  7678. }
  7679. func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  7680. if rv.Kind() == reflect.Ptr {
  7681. vp := rv2i(rv).(*map[uint64]int64)
  7682. if v, changed := fastpathTV.DecMapUint64Int64V(*vp, true, d); changed {
  7683. *vp = v
  7684. }
  7685. } else {
  7686. fastpathTV.DecMapUint64Int64V(rv2i(rv).(map[uint64]int64), false, d)
  7687. }
  7688. }
  7689. func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) {
  7690. if v, changed := f.DecMapUint64Int64V(*vp, true, d); changed {
  7691. *vp = v
  7692. }
  7693. }
  7694. func (fastpathT) DecMapUint64Int64V(v map[uint64]int64, canChange bool,
  7695. d *Decoder) (_ map[uint64]int64, changed bool) {
  7696. containerLen := d.mapStart()
  7697. if canChange && v == nil {
  7698. v = make(map[uint64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7699. changed = true
  7700. }
  7701. if containerLen == 0 {
  7702. d.mapEnd()
  7703. return v, changed
  7704. }
  7705. var mk uint64
  7706. var mv int64
  7707. hasLen := containerLen > 0
  7708. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7709. d.mapElemKey()
  7710. mk = d.d.DecodeUint64()
  7711. d.mapElemValue()
  7712. if d.d.TryDecodeAsNil() {
  7713. if v == nil {
  7714. } else if d.h.DeleteOnNilMapValue {
  7715. delete(v, mk)
  7716. } else {
  7717. v[mk] = 0
  7718. }
  7719. continue
  7720. }
  7721. mv = d.d.DecodeInt64()
  7722. if v != nil {
  7723. v[mk] = mv
  7724. }
  7725. }
  7726. d.mapEnd()
  7727. return v, changed
  7728. }
  7729. func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  7730. if rv.Kind() == reflect.Ptr {
  7731. vp := rv2i(rv).(*map[uint64]float32)
  7732. if v, changed := fastpathTV.DecMapUint64Float32V(*vp, true, d); changed {
  7733. *vp = v
  7734. }
  7735. } else {
  7736. fastpathTV.DecMapUint64Float32V(rv2i(rv).(map[uint64]float32), false, d)
  7737. }
  7738. }
  7739. func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) {
  7740. if v, changed := f.DecMapUint64Float32V(*vp, true, d); changed {
  7741. *vp = v
  7742. }
  7743. }
  7744. func (fastpathT) DecMapUint64Float32V(v map[uint64]float32, canChange bool,
  7745. d *Decoder) (_ map[uint64]float32, changed bool) {
  7746. containerLen := d.mapStart()
  7747. if canChange && v == nil {
  7748. v = make(map[uint64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  7749. changed = true
  7750. }
  7751. if containerLen == 0 {
  7752. d.mapEnd()
  7753. return v, changed
  7754. }
  7755. var mk uint64
  7756. var mv float32
  7757. hasLen := containerLen > 0
  7758. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7759. d.mapElemKey()
  7760. mk = d.d.DecodeUint64()
  7761. d.mapElemValue()
  7762. if d.d.TryDecodeAsNil() {
  7763. if v == nil {
  7764. } else if d.h.DeleteOnNilMapValue {
  7765. delete(v, mk)
  7766. } else {
  7767. v[mk] = 0
  7768. }
  7769. continue
  7770. }
  7771. mv = float32(d.decodeFloat32())
  7772. if v != nil {
  7773. v[mk] = mv
  7774. }
  7775. }
  7776. d.mapEnd()
  7777. return v, changed
  7778. }
  7779. func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  7780. if rv.Kind() == reflect.Ptr {
  7781. vp := rv2i(rv).(*map[uint64]float64)
  7782. if v, changed := fastpathTV.DecMapUint64Float64V(*vp, true, d); changed {
  7783. *vp = v
  7784. }
  7785. } else {
  7786. fastpathTV.DecMapUint64Float64V(rv2i(rv).(map[uint64]float64), false, d)
  7787. }
  7788. }
  7789. func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
  7790. if v, changed := f.DecMapUint64Float64V(*vp, true, d); changed {
  7791. *vp = v
  7792. }
  7793. }
  7794. func (fastpathT) DecMapUint64Float64V(v map[uint64]float64, canChange bool,
  7795. d *Decoder) (_ map[uint64]float64, changed bool) {
  7796. containerLen := d.mapStart()
  7797. if canChange && v == nil {
  7798. v = make(map[uint64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7799. changed = true
  7800. }
  7801. if containerLen == 0 {
  7802. d.mapEnd()
  7803. return v, changed
  7804. }
  7805. var mk uint64
  7806. var mv float64
  7807. hasLen := containerLen > 0
  7808. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7809. d.mapElemKey()
  7810. mk = d.d.DecodeUint64()
  7811. d.mapElemValue()
  7812. if d.d.TryDecodeAsNil() {
  7813. if v == nil {
  7814. } else if d.h.DeleteOnNilMapValue {
  7815. delete(v, mk)
  7816. } else {
  7817. v[mk] = 0
  7818. }
  7819. continue
  7820. }
  7821. mv = d.d.DecodeFloat64()
  7822. if v != nil {
  7823. v[mk] = mv
  7824. }
  7825. }
  7826. d.mapEnd()
  7827. return v, changed
  7828. }
  7829. func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  7830. if rv.Kind() == reflect.Ptr {
  7831. vp := rv2i(rv).(*map[uint64]bool)
  7832. if v, changed := fastpathTV.DecMapUint64BoolV(*vp, true, d); changed {
  7833. *vp = v
  7834. }
  7835. } else {
  7836. fastpathTV.DecMapUint64BoolV(rv2i(rv).(map[uint64]bool), false, d)
  7837. }
  7838. }
  7839. func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
  7840. if v, changed := f.DecMapUint64BoolV(*vp, true, d); changed {
  7841. *vp = v
  7842. }
  7843. }
  7844. func (fastpathT) DecMapUint64BoolV(v map[uint64]bool, canChange bool,
  7845. d *Decoder) (_ map[uint64]bool, changed bool) {
  7846. containerLen := d.mapStart()
  7847. if canChange && v == nil {
  7848. v = make(map[uint64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7849. changed = true
  7850. }
  7851. if containerLen == 0 {
  7852. d.mapEnd()
  7853. return v, changed
  7854. }
  7855. var mk uint64
  7856. var mv bool
  7857. hasLen := containerLen > 0
  7858. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7859. d.mapElemKey()
  7860. mk = d.d.DecodeUint64()
  7861. d.mapElemValue()
  7862. if d.d.TryDecodeAsNil() {
  7863. if v == nil {
  7864. } else if d.h.DeleteOnNilMapValue {
  7865. delete(v, mk)
  7866. } else {
  7867. v[mk] = false
  7868. }
  7869. continue
  7870. }
  7871. mv = d.d.DecodeBool()
  7872. if v != nil {
  7873. v[mk] = mv
  7874. }
  7875. }
  7876. d.mapEnd()
  7877. return v, changed
  7878. }
  7879. func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  7880. if rv.Kind() == reflect.Ptr {
  7881. vp := rv2i(rv).(*map[int]interface{})
  7882. if v, changed := fastpathTV.DecMapIntIntfV(*vp, true, d); changed {
  7883. *vp = v
  7884. }
  7885. } else {
  7886. fastpathTV.DecMapIntIntfV(rv2i(rv).(map[int]interface{}), false, d)
  7887. }
  7888. }
  7889. func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
  7890. if v, changed := f.DecMapIntIntfV(*vp, true, d); changed {
  7891. *vp = v
  7892. }
  7893. }
  7894. func (fastpathT) DecMapIntIntfV(v map[int]interface{}, canChange bool,
  7895. d *Decoder) (_ map[int]interface{}, changed bool) {
  7896. containerLen := d.mapStart()
  7897. if canChange && v == nil {
  7898. v = make(map[int]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7899. changed = true
  7900. }
  7901. if containerLen == 0 {
  7902. d.mapEnd()
  7903. return v, changed
  7904. }
  7905. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7906. var mk int
  7907. var mv interface{}
  7908. hasLen := containerLen > 0
  7909. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7910. d.mapElemKey()
  7911. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7912. d.mapElemValue()
  7913. if d.d.TryDecodeAsNil() {
  7914. if v == nil {
  7915. } else if d.h.DeleteOnNilMapValue {
  7916. delete(v, mk)
  7917. } else {
  7918. v[mk] = nil
  7919. }
  7920. continue
  7921. }
  7922. if mapGet {
  7923. mv = v[mk]
  7924. } else {
  7925. mv = nil
  7926. }
  7927. d.decode(&mv)
  7928. if v != nil {
  7929. v[mk] = mv
  7930. }
  7931. }
  7932. d.mapEnd()
  7933. return v, changed
  7934. }
  7935. func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  7936. if rv.Kind() == reflect.Ptr {
  7937. vp := rv2i(rv).(*map[int]string)
  7938. if v, changed := fastpathTV.DecMapIntStringV(*vp, true, d); changed {
  7939. *vp = v
  7940. }
  7941. } else {
  7942. fastpathTV.DecMapIntStringV(rv2i(rv).(map[int]string), false, d)
  7943. }
  7944. }
  7945. func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
  7946. if v, changed := f.DecMapIntStringV(*vp, true, d); changed {
  7947. *vp = v
  7948. }
  7949. }
  7950. func (fastpathT) DecMapIntStringV(v map[int]string, canChange bool,
  7951. d *Decoder) (_ map[int]string, changed bool) {
  7952. containerLen := d.mapStart()
  7953. if canChange && v == nil {
  7954. v = make(map[int]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7955. changed = true
  7956. }
  7957. if containerLen == 0 {
  7958. d.mapEnd()
  7959. return v, changed
  7960. }
  7961. var mk int
  7962. var mv string
  7963. hasLen := containerLen > 0
  7964. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7965. d.mapElemKey()
  7966. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7967. d.mapElemValue()
  7968. if d.d.TryDecodeAsNil() {
  7969. if v == nil {
  7970. } else if d.h.DeleteOnNilMapValue {
  7971. delete(v, mk)
  7972. } else {
  7973. v[mk] = ""
  7974. }
  7975. continue
  7976. }
  7977. mv = d.d.DecodeString()
  7978. if v != nil {
  7979. v[mk] = mv
  7980. }
  7981. }
  7982. d.mapEnd()
  7983. return v, changed
  7984. }
  7985. func (d *Decoder) fastpathDecMapIntBytesR(f *codecFnInfo, rv reflect.Value) {
  7986. if rv.Kind() == reflect.Ptr {
  7987. vp := rv2i(rv).(*map[int][]byte)
  7988. if v, changed := fastpathTV.DecMapIntBytesV(*vp, true, d); changed {
  7989. *vp = v
  7990. }
  7991. } else {
  7992. fastpathTV.DecMapIntBytesV(rv2i(rv).(map[int][]byte), false, d)
  7993. }
  7994. }
  7995. func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) {
  7996. if v, changed := f.DecMapIntBytesV(*vp, true, d); changed {
  7997. *vp = v
  7998. }
  7999. }
  8000. func (fastpathT) DecMapIntBytesV(v map[int][]byte, canChange bool,
  8001. d *Decoder) (_ map[int][]byte, changed bool) {
  8002. containerLen := d.mapStart()
  8003. if canChange && v == nil {
  8004. v = make(map[int][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8005. changed = true
  8006. }
  8007. if containerLen == 0 {
  8008. d.mapEnd()
  8009. return v, changed
  8010. }
  8011. mapGet := v != nil && !d.h.MapValueReset
  8012. var mk int
  8013. var mv []byte
  8014. hasLen := containerLen > 0
  8015. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8016. d.mapElemKey()
  8017. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8018. d.mapElemValue()
  8019. if d.d.TryDecodeAsNil() {
  8020. if v == nil {
  8021. } else if d.h.DeleteOnNilMapValue {
  8022. delete(v, mk)
  8023. } else {
  8024. v[mk] = nil
  8025. }
  8026. continue
  8027. }
  8028. if mapGet {
  8029. mv = v[mk]
  8030. } else {
  8031. mv = nil
  8032. }
  8033. mv = d.d.DecodeBytes(mv, false)
  8034. if v != nil {
  8035. v[mk] = mv
  8036. }
  8037. }
  8038. d.mapEnd()
  8039. return v, changed
  8040. }
  8041. func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  8042. if rv.Kind() == reflect.Ptr {
  8043. vp := rv2i(rv).(*map[int]uint)
  8044. if v, changed := fastpathTV.DecMapIntUintV(*vp, true, d); changed {
  8045. *vp = v
  8046. }
  8047. } else {
  8048. fastpathTV.DecMapIntUintV(rv2i(rv).(map[int]uint), false, d)
  8049. }
  8050. }
  8051. func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) {
  8052. if v, changed := f.DecMapIntUintV(*vp, true, d); changed {
  8053. *vp = v
  8054. }
  8055. }
  8056. func (fastpathT) DecMapIntUintV(v map[int]uint, canChange bool,
  8057. d *Decoder) (_ map[int]uint, changed bool) {
  8058. containerLen := d.mapStart()
  8059. if canChange && v == nil {
  8060. v = make(map[int]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8061. changed = true
  8062. }
  8063. if containerLen == 0 {
  8064. d.mapEnd()
  8065. return v, changed
  8066. }
  8067. var mk int
  8068. var mv uint
  8069. hasLen := containerLen > 0
  8070. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8071. d.mapElemKey()
  8072. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8073. d.mapElemValue()
  8074. if d.d.TryDecodeAsNil() {
  8075. if v == nil {
  8076. } else if d.h.DeleteOnNilMapValue {
  8077. delete(v, mk)
  8078. } else {
  8079. v[mk] = 0
  8080. }
  8081. continue
  8082. }
  8083. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8084. if v != nil {
  8085. v[mk] = mv
  8086. }
  8087. }
  8088. d.mapEnd()
  8089. return v, changed
  8090. }
  8091. func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  8092. if rv.Kind() == reflect.Ptr {
  8093. vp := rv2i(rv).(*map[int]uint8)
  8094. if v, changed := fastpathTV.DecMapIntUint8V(*vp, true, d); changed {
  8095. *vp = v
  8096. }
  8097. } else {
  8098. fastpathTV.DecMapIntUint8V(rv2i(rv).(map[int]uint8), false, d)
  8099. }
  8100. }
  8101. func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
  8102. if v, changed := f.DecMapIntUint8V(*vp, true, d); changed {
  8103. *vp = v
  8104. }
  8105. }
  8106. func (fastpathT) DecMapIntUint8V(v map[int]uint8, canChange bool,
  8107. d *Decoder) (_ map[int]uint8, changed bool) {
  8108. containerLen := d.mapStart()
  8109. if canChange && v == nil {
  8110. v = make(map[int]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8111. changed = true
  8112. }
  8113. if containerLen == 0 {
  8114. d.mapEnd()
  8115. return v, changed
  8116. }
  8117. var mk int
  8118. var mv uint8
  8119. hasLen := containerLen > 0
  8120. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8121. d.mapElemKey()
  8122. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8123. d.mapElemValue()
  8124. if d.d.TryDecodeAsNil() {
  8125. if v == nil {
  8126. } else if d.h.DeleteOnNilMapValue {
  8127. delete(v, mk)
  8128. } else {
  8129. v[mk] = 0
  8130. }
  8131. continue
  8132. }
  8133. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8134. if v != nil {
  8135. v[mk] = mv
  8136. }
  8137. }
  8138. d.mapEnd()
  8139. return v, changed
  8140. }
  8141. func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  8142. if rv.Kind() == reflect.Ptr {
  8143. vp := rv2i(rv).(*map[int]uint64)
  8144. if v, changed := fastpathTV.DecMapIntUint64V(*vp, true, d); changed {
  8145. *vp = v
  8146. }
  8147. } else {
  8148. fastpathTV.DecMapIntUint64V(rv2i(rv).(map[int]uint64), false, d)
  8149. }
  8150. }
  8151. func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
  8152. if v, changed := f.DecMapIntUint64V(*vp, true, d); changed {
  8153. *vp = v
  8154. }
  8155. }
  8156. func (fastpathT) DecMapIntUint64V(v map[int]uint64, canChange bool,
  8157. d *Decoder) (_ map[int]uint64, changed bool) {
  8158. containerLen := d.mapStart()
  8159. if canChange && v == nil {
  8160. v = make(map[int]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8161. changed = true
  8162. }
  8163. if containerLen == 0 {
  8164. d.mapEnd()
  8165. return v, changed
  8166. }
  8167. var mk int
  8168. var mv uint64
  8169. hasLen := containerLen > 0
  8170. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8171. d.mapElemKey()
  8172. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8173. d.mapElemValue()
  8174. if d.d.TryDecodeAsNil() {
  8175. if v == nil {
  8176. } else if d.h.DeleteOnNilMapValue {
  8177. delete(v, mk)
  8178. } else {
  8179. v[mk] = 0
  8180. }
  8181. continue
  8182. }
  8183. mv = d.d.DecodeUint64()
  8184. if v != nil {
  8185. v[mk] = mv
  8186. }
  8187. }
  8188. d.mapEnd()
  8189. return v, changed
  8190. }
  8191. func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  8192. if rv.Kind() == reflect.Ptr {
  8193. vp := rv2i(rv).(*map[int]int)
  8194. if v, changed := fastpathTV.DecMapIntIntV(*vp, true, d); changed {
  8195. *vp = v
  8196. }
  8197. } else {
  8198. fastpathTV.DecMapIntIntV(rv2i(rv).(map[int]int), false, d)
  8199. }
  8200. }
  8201. func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
  8202. if v, changed := f.DecMapIntIntV(*vp, true, d); changed {
  8203. *vp = v
  8204. }
  8205. }
  8206. func (fastpathT) DecMapIntIntV(v map[int]int, canChange bool,
  8207. d *Decoder) (_ map[int]int, changed bool) {
  8208. containerLen := d.mapStart()
  8209. if canChange && v == nil {
  8210. v = make(map[int]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8211. changed = true
  8212. }
  8213. if containerLen == 0 {
  8214. d.mapEnd()
  8215. return v, changed
  8216. }
  8217. var mk int
  8218. var mv int
  8219. hasLen := containerLen > 0
  8220. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8221. d.mapElemKey()
  8222. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8223. d.mapElemValue()
  8224. if d.d.TryDecodeAsNil() {
  8225. if v == nil {
  8226. } else if d.h.DeleteOnNilMapValue {
  8227. delete(v, mk)
  8228. } else {
  8229. v[mk] = 0
  8230. }
  8231. continue
  8232. }
  8233. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8234. if v != nil {
  8235. v[mk] = mv
  8236. }
  8237. }
  8238. d.mapEnd()
  8239. return v, changed
  8240. }
  8241. func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  8242. if rv.Kind() == reflect.Ptr {
  8243. vp := rv2i(rv).(*map[int]int64)
  8244. if v, changed := fastpathTV.DecMapIntInt64V(*vp, true, d); changed {
  8245. *vp = v
  8246. }
  8247. } else {
  8248. fastpathTV.DecMapIntInt64V(rv2i(rv).(map[int]int64), false, d)
  8249. }
  8250. }
  8251. func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) {
  8252. if v, changed := f.DecMapIntInt64V(*vp, true, d); changed {
  8253. *vp = v
  8254. }
  8255. }
  8256. func (fastpathT) DecMapIntInt64V(v map[int]int64, canChange bool,
  8257. d *Decoder) (_ map[int]int64, changed bool) {
  8258. containerLen := d.mapStart()
  8259. if canChange && v == nil {
  8260. v = make(map[int]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8261. changed = true
  8262. }
  8263. if containerLen == 0 {
  8264. d.mapEnd()
  8265. return v, changed
  8266. }
  8267. var mk int
  8268. var mv int64
  8269. hasLen := containerLen > 0
  8270. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8271. d.mapElemKey()
  8272. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8273. d.mapElemValue()
  8274. if d.d.TryDecodeAsNil() {
  8275. if v == nil {
  8276. } else if d.h.DeleteOnNilMapValue {
  8277. delete(v, mk)
  8278. } else {
  8279. v[mk] = 0
  8280. }
  8281. continue
  8282. }
  8283. mv = d.d.DecodeInt64()
  8284. if v != nil {
  8285. v[mk] = mv
  8286. }
  8287. }
  8288. d.mapEnd()
  8289. return v, changed
  8290. }
  8291. func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  8292. if rv.Kind() == reflect.Ptr {
  8293. vp := rv2i(rv).(*map[int]float32)
  8294. if v, changed := fastpathTV.DecMapIntFloat32V(*vp, true, d); changed {
  8295. *vp = v
  8296. }
  8297. } else {
  8298. fastpathTV.DecMapIntFloat32V(rv2i(rv).(map[int]float32), false, d)
  8299. }
  8300. }
  8301. func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) {
  8302. if v, changed := f.DecMapIntFloat32V(*vp, true, d); changed {
  8303. *vp = v
  8304. }
  8305. }
  8306. func (fastpathT) DecMapIntFloat32V(v map[int]float32, canChange bool,
  8307. d *Decoder) (_ map[int]float32, changed bool) {
  8308. containerLen := d.mapStart()
  8309. if canChange && v == nil {
  8310. v = make(map[int]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8311. changed = true
  8312. }
  8313. if containerLen == 0 {
  8314. d.mapEnd()
  8315. return v, changed
  8316. }
  8317. var mk int
  8318. var mv float32
  8319. hasLen := containerLen > 0
  8320. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8321. d.mapElemKey()
  8322. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8323. d.mapElemValue()
  8324. if d.d.TryDecodeAsNil() {
  8325. if v == nil {
  8326. } else if d.h.DeleteOnNilMapValue {
  8327. delete(v, mk)
  8328. } else {
  8329. v[mk] = 0
  8330. }
  8331. continue
  8332. }
  8333. mv = float32(d.decodeFloat32())
  8334. if v != nil {
  8335. v[mk] = mv
  8336. }
  8337. }
  8338. d.mapEnd()
  8339. return v, changed
  8340. }
  8341. func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  8342. if rv.Kind() == reflect.Ptr {
  8343. vp := rv2i(rv).(*map[int]float64)
  8344. if v, changed := fastpathTV.DecMapIntFloat64V(*vp, true, d); changed {
  8345. *vp = v
  8346. }
  8347. } else {
  8348. fastpathTV.DecMapIntFloat64V(rv2i(rv).(map[int]float64), false, d)
  8349. }
  8350. }
  8351. func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
  8352. if v, changed := f.DecMapIntFloat64V(*vp, true, d); changed {
  8353. *vp = v
  8354. }
  8355. }
  8356. func (fastpathT) DecMapIntFloat64V(v map[int]float64, canChange bool,
  8357. d *Decoder) (_ map[int]float64, changed bool) {
  8358. containerLen := d.mapStart()
  8359. if canChange && v == nil {
  8360. v = make(map[int]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8361. changed = true
  8362. }
  8363. if containerLen == 0 {
  8364. d.mapEnd()
  8365. return v, changed
  8366. }
  8367. var mk int
  8368. var mv float64
  8369. hasLen := containerLen > 0
  8370. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8371. d.mapElemKey()
  8372. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8373. d.mapElemValue()
  8374. if d.d.TryDecodeAsNil() {
  8375. if v == nil {
  8376. } else if d.h.DeleteOnNilMapValue {
  8377. delete(v, mk)
  8378. } else {
  8379. v[mk] = 0
  8380. }
  8381. continue
  8382. }
  8383. mv = d.d.DecodeFloat64()
  8384. if v != nil {
  8385. v[mk] = mv
  8386. }
  8387. }
  8388. d.mapEnd()
  8389. return v, changed
  8390. }
  8391. func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  8392. if rv.Kind() == reflect.Ptr {
  8393. vp := rv2i(rv).(*map[int]bool)
  8394. if v, changed := fastpathTV.DecMapIntBoolV(*vp, true, d); changed {
  8395. *vp = v
  8396. }
  8397. } else {
  8398. fastpathTV.DecMapIntBoolV(rv2i(rv).(map[int]bool), false, d)
  8399. }
  8400. }
  8401. func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
  8402. if v, changed := f.DecMapIntBoolV(*vp, true, d); changed {
  8403. *vp = v
  8404. }
  8405. }
  8406. func (fastpathT) DecMapIntBoolV(v map[int]bool, canChange bool,
  8407. d *Decoder) (_ map[int]bool, changed bool) {
  8408. containerLen := d.mapStart()
  8409. if canChange && v == nil {
  8410. v = make(map[int]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8411. changed = true
  8412. }
  8413. if containerLen == 0 {
  8414. d.mapEnd()
  8415. return v, changed
  8416. }
  8417. var mk int
  8418. var mv bool
  8419. hasLen := containerLen > 0
  8420. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8421. d.mapElemKey()
  8422. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8423. d.mapElemValue()
  8424. if d.d.TryDecodeAsNil() {
  8425. if v == nil {
  8426. } else if d.h.DeleteOnNilMapValue {
  8427. delete(v, mk)
  8428. } else {
  8429. v[mk] = false
  8430. }
  8431. continue
  8432. }
  8433. mv = d.d.DecodeBool()
  8434. if v != nil {
  8435. v[mk] = mv
  8436. }
  8437. }
  8438. d.mapEnd()
  8439. return v, changed
  8440. }
  8441. func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  8442. if rv.Kind() == reflect.Ptr {
  8443. vp := rv2i(rv).(*map[int64]interface{})
  8444. if v, changed := fastpathTV.DecMapInt64IntfV(*vp, true, d); changed {
  8445. *vp = v
  8446. }
  8447. } else {
  8448. fastpathTV.DecMapInt64IntfV(rv2i(rv).(map[int64]interface{}), false, d)
  8449. }
  8450. }
  8451. func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) {
  8452. if v, changed := f.DecMapInt64IntfV(*vp, true, d); changed {
  8453. *vp = v
  8454. }
  8455. }
  8456. func (fastpathT) DecMapInt64IntfV(v map[int64]interface{}, canChange bool,
  8457. d *Decoder) (_ map[int64]interface{}, changed bool) {
  8458. containerLen := d.mapStart()
  8459. if canChange && v == nil {
  8460. v = make(map[int64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8461. changed = true
  8462. }
  8463. if containerLen == 0 {
  8464. d.mapEnd()
  8465. return v, changed
  8466. }
  8467. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  8468. var mk int64
  8469. var mv interface{}
  8470. hasLen := containerLen > 0
  8471. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8472. d.mapElemKey()
  8473. mk = d.d.DecodeInt64()
  8474. d.mapElemValue()
  8475. if d.d.TryDecodeAsNil() {
  8476. if v == nil {
  8477. } else if d.h.DeleteOnNilMapValue {
  8478. delete(v, mk)
  8479. } else {
  8480. v[mk] = nil
  8481. }
  8482. continue
  8483. }
  8484. if mapGet {
  8485. mv = v[mk]
  8486. } else {
  8487. mv = nil
  8488. }
  8489. d.decode(&mv)
  8490. if v != nil {
  8491. v[mk] = mv
  8492. }
  8493. }
  8494. d.mapEnd()
  8495. return v, changed
  8496. }
  8497. func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  8498. if rv.Kind() == reflect.Ptr {
  8499. vp := rv2i(rv).(*map[int64]string)
  8500. if v, changed := fastpathTV.DecMapInt64StringV(*vp, true, d); changed {
  8501. *vp = v
  8502. }
  8503. } else {
  8504. fastpathTV.DecMapInt64StringV(rv2i(rv).(map[int64]string), false, d)
  8505. }
  8506. }
  8507. func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) {
  8508. if v, changed := f.DecMapInt64StringV(*vp, true, d); changed {
  8509. *vp = v
  8510. }
  8511. }
  8512. func (fastpathT) DecMapInt64StringV(v map[int64]string, canChange bool,
  8513. d *Decoder) (_ map[int64]string, changed bool) {
  8514. containerLen := d.mapStart()
  8515. if canChange && v == nil {
  8516. v = make(map[int64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8517. changed = true
  8518. }
  8519. if containerLen == 0 {
  8520. d.mapEnd()
  8521. return v, changed
  8522. }
  8523. var mk int64
  8524. var mv string
  8525. hasLen := containerLen > 0
  8526. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8527. d.mapElemKey()
  8528. mk = d.d.DecodeInt64()
  8529. d.mapElemValue()
  8530. if d.d.TryDecodeAsNil() {
  8531. if v == nil {
  8532. } else if d.h.DeleteOnNilMapValue {
  8533. delete(v, mk)
  8534. } else {
  8535. v[mk] = ""
  8536. }
  8537. continue
  8538. }
  8539. mv = d.d.DecodeString()
  8540. if v != nil {
  8541. v[mk] = mv
  8542. }
  8543. }
  8544. d.mapEnd()
  8545. return v, changed
  8546. }
  8547. func (d *Decoder) fastpathDecMapInt64BytesR(f *codecFnInfo, rv reflect.Value) {
  8548. if rv.Kind() == reflect.Ptr {
  8549. vp := rv2i(rv).(*map[int64][]byte)
  8550. if v, changed := fastpathTV.DecMapInt64BytesV(*vp, true, d); changed {
  8551. *vp = v
  8552. }
  8553. } else {
  8554. fastpathTV.DecMapInt64BytesV(rv2i(rv).(map[int64][]byte), false, d)
  8555. }
  8556. }
  8557. func (f fastpathT) DecMapInt64BytesX(vp *map[int64][]byte, d *Decoder) {
  8558. if v, changed := f.DecMapInt64BytesV(*vp, true, d); changed {
  8559. *vp = v
  8560. }
  8561. }
  8562. func (fastpathT) DecMapInt64BytesV(v map[int64][]byte, canChange bool,
  8563. d *Decoder) (_ map[int64][]byte, changed bool) {
  8564. containerLen := d.mapStart()
  8565. if canChange && v == nil {
  8566. v = make(map[int64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8567. changed = true
  8568. }
  8569. if containerLen == 0 {
  8570. d.mapEnd()
  8571. return v, changed
  8572. }
  8573. mapGet := v != nil && !d.h.MapValueReset
  8574. var mk int64
  8575. var mv []byte
  8576. hasLen := containerLen > 0
  8577. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8578. d.mapElemKey()
  8579. mk = d.d.DecodeInt64()
  8580. d.mapElemValue()
  8581. if d.d.TryDecodeAsNil() {
  8582. if v == nil {
  8583. } else if d.h.DeleteOnNilMapValue {
  8584. delete(v, mk)
  8585. } else {
  8586. v[mk] = nil
  8587. }
  8588. continue
  8589. }
  8590. if mapGet {
  8591. mv = v[mk]
  8592. } else {
  8593. mv = nil
  8594. }
  8595. mv = d.d.DecodeBytes(mv, false)
  8596. if v != nil {
  8597. v[mk] = mv
  8598. }
  8599. }
  8600. d.mapEnd()
  8601. return v, changed
  8602. }
  8603. func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  8604. if rv.Kind() == reflect.Ptr {
  8605. vp := rv2i(rv).(*map[int64]uint)
  8606. if v, changed := fastpathTV.DecMapInt64UintV(*vp, true, d); changed {
  8607. *vp = v
  8608. }
  8609. } else {
  8610. fastpathTV.DecMapInt64UintV(rv2i(rv).(map[int64]uint), false, d)
  8611. }
  8612. }
  8613. func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) {
  8614. if v, changed := f.DecMapInt64UintV(*vp, true, d); changed {
  8615. *vp = v
  8616. }
  8617. }
  8618. func (fastpathT) DecMapInt64UintV(v map[int64]uint, canChange bool,
  8619. d *Decoder) (_ map[int64]uint, changed bool) {
  8620. containerLen := d.mapStart()
  8621. if canChange && v == nil {
  8622. v = make(map[int64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8623. changed = true
  8624. }
  8625. if containerLen == 0 {
  8626. d.mapEnd()
  8627. return v, changed
  8628. }
  8629. var mk int64
  8630. var mv uint
  8631. hasLen := containerLen > 0
  8632. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8633. d.mapElemKey()
  8634. mk = d.d.DecodeInt64()
  8635. d.mapElemValue()
  8636. if d.d.TryDecodeAsNil() {
  8637. if v == nil {
  8638. } else if d.h.DeleteOnNilMapValue {
  8639. delete(v, mk)
  8640. } else {
  8641. v[mk] = 0
  8642. }
  8643. continue
  8644. }
  8645. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8646. if v != nil {
  8647. v[mk] = mv
  8648. }
  8649. }
  8650. d.mapEnd()
  8651. return v, changed
  8652. }
  8653. func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  8654. if rv.Kind() == reflect.Ptr {
  8655. vp := rv2i(rv).(*map[int64]uint8)
  8656. if v, changed := fastpathTV.DecMapInt64Uint8V(*vp, true, d); changed {
  8657. *vp = v
  8658. }
  8659. } else {
  8660. fastpathTV.DecMapInt64Uint8V(rv2i(rv).(map[int64]uint8), false, d)
  8661. }
  8662. }
  8663. func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) {
  8664. if v, changed := f.DecMapInt64Uint8V(*vp, true, d); changed {
  8665. *vp = v
  8666. }
  8667. }
  8668. func (fastpathT) DecMapInt64Uint8V(v map[int64]uint8, canChange bool,
  8669. d *Decoder) (_ map[int64]uint8, changed bool) {
  8670. containerLen := d.mapStart()
  8671. if canChange && v == nil {
  8672. v = make(map[int64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8673. changed = true
  8674. }
  8675. if containerLen == 0 {
  8676. d.mapEnd()
  8677. return v, changed
  8678. }
  8679. var mk int64
  8680. var mv uint8
  8681. hasLen := containerLen > 0
  8682. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8683. d.mapElemKey()
  8684. mk = d.d.DecodeInt64()
  8685. d.mapElemValue()
  8686. if d.d.TryDecodeAsNil() {
  8687. if v == nil {
  8688. } else if d.h.DeleteOnNilMapValue {
  8689. delete(v, mk)
  8690. } else {
  8691. v[mk] = 0
  8692. }
  8693. continue
  8694. }
  8695. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8696. if v != nil {
  8697. v[mk] = mv
  8698. }
  8699. }
  8700. d.mapEnd()
  8701. return v, changed
  8702. }
  8703. func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  8704. if rv.Kind() == reflect.Ptr {
  8705. vp := rv2i(rv).(*map[int64]uint64)
  8706. if v, changed := fastpathTV.DecMapInt64Uint64V(*vp, true, d); changed {
  8707. *vp = v
  8708. }
  8709. } else {
  8710. fastpathTV.DecMapInt64Uint64V(rv2i(rv).(map[int64]uint64), false, d)
  8711. }
  8712. }
  8713. func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) {
  8714. if v, changed := f.DecMapInt64Uint64V(*vp, true, d); changed {
  8715. *vp = v
  8716. }
  8717. }
  8718. func (fastpathT) DecMapInt64Uint64V(v map[int64]uint64, canChange bool,
  8719. d *Decoder) (_ map[int64]uint64, changed bool) {
  8720. containerLen := d.mapStart()
  8721. if canChange && v == nil {
  8722. v = make(map[int64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8723. changed = true
  8724. }
  8725. if containerLen == 0 {
  8726. d.mapEnd()
  8727. return v, changed
  8728. }
  8729. var mk int64
  8730. var mv uint64
  8731. hasLen := containerLen > 0
  8732. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8733. d.mapElemKey()
  8734. mk = d.d.DecodeInt64()
  8735. d.mapElemValue()
  8736. if d.d.TryDecodeAsNil() {
  8737. if v == nil {
  8738. } else if d.h.DeleteOnNilMapValue {
  8739. delete(v, mk)
  8740. } else {
  8741. v[mk] = 0
  8742. }
  8743. continue
  8744. }
  8745. mv = d.d.DecodeUint64()
  8746. if v != nil {
  8747. v[mk] = mv
  8748. }
  8749. }
  8750. d.mapEnd()
  8751. return v, changed
  8752. }
  8753. func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  8754. if rv.Kind() == reflect.Ptr {
  8755. vp := rv2i(rv).(*map[int64]int)
  8756. if v, changed := fastpathTV.DecMapInt64IntV(*vp, true, d); changed {
  8757. *vp = v
  8758. }
  8759. } else {
  8760. fastpathTV.DecMapInt64IntV(rv2i(rv).(map[int64]int), false, d)
  8761. }
  8762. }
  8763. func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) {
  8764. if v, changed := f.DecMapInt64IntV(*vp, true, d); changed {
  8765. *vp = v
  8766. }
  8767. }
  8768. func (fastpathT) DecMapInt64IntV(v map[int64]int, canChange bool,
  8769. d *Decoder) (_ map[int64]int, changed bool) {
  8770. containerLen := d.mapStart()
  8771. if canChange && v == nil {
  8772. v = make(map[int64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8773. changed = true
  8774. }
  8775. if containerLen == 0 {
  8776. d.mapEnd()
  8777. return v, changed
  8778. }
  8779. var mk int64
  8780. var mv int
  8781. hasLen := containerLen > 0
  8782. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8783. d.mapElemKey()
  8784. mk = d.d.DecodeInt64()
  8785. d.mapElemValue()
  8786. if d.d.TryDecodeAsNil() {
  8787. if v == nil {
  8788. } else if d.h.DeleteOnNilMapValue {
  8789. delete(v, mk)
  8790. } else {
  8791. v[mk] = 0
  8792. }
  8793. continue
  8794. }
  8795. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8796. if v != nil {
  8797. v[mk] = mv
  8798. }
  8799. }
  8800. d.mapEnd()
  8801. return v, changed
  8802. }
  8803. func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  8804. if rv.Kind() == reflect.Ptr {
  8805. vp := rv2i(rv).(*map[int64]int64)
  8806. if v, changed := fastpathTV.DecMapInt64Int64V(*vp, true, d); changed {
  8807. *vp = v
  8808. }
  8809. } else {
  8810. fastpathTV.DecMapInt64Int64V(rv2i(rv).(map[int64]int64), false, d)
  8811. }
  8812. }
  8813. func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) {
  8814. if v, changed := f.DecMapInt64Int64V(*vp, true, d); changed {
  8815. *vp = v
  8816. }
  8817. }
  8818. func (fastpathT) DecMapInt64Int64V(v map[int64]int64, canChange bool,
  8819. d *Decoder) (_ map[int64]int64, changed bool) {
  8820. containerLen := d.mapStart()
  8821. if canChange && v == nil {
  8822. v = make(map[int64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8823. changed = true
  8824. }
  8825. if containerLen == 0 {
  8826. d.mapEnd()
  8827. return v, changed
  8828. }
  8829. var mk int64
  8830. var mv int64
  8831. hasLen := containerLen > 0
  8832. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8833. d.mapElemKey()
  8834. mk = d.d.DecodeInt64()
  8835. d.mapElemValue()
  8836. if d.d.TryDecodeAsNil() {
  8837. if v == nil {
  8838. } else if d.h.DeleteOnNilMapValue {
  8839. delete(v, mk)
  8840. } else {
  8841. v[mk] = 0
  8842. }
  8843. continue
  8844. }
  8845. mv = d.d.DecodeInt64()
  8846. if v != nil {
  8847. v[mk] = mv
  8848. }
  8849. }
  8850. d.mapEnd()
  8851. return v, changed
  8852. }
  8853. func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  8854. if rv.Kind() == reflect.Ptr {
  8855. vp := rv2i(rv).(*map[int64]float32)
  8856. if v, changed := fastpathTV.DecMapInt64Float32V(*vp, true, d); changed {
  8857. *vp = v
  8858. }
  8859. } else {
  8860. fastpathTV.DecMapInt64Float32V(rv2i(rv).(map[int64]float32), false, d)
  8861. }
  8862. }
  8863. func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) {
  8864. if v, changed := f.DecMapInt64Float32V(*vp, true, d); changed {
  8865. *vp = v
  8866. }
  8867. }
  8868. func (fastpathT) DecMapInt64Float32V(v map[int64]float32, canChange bool,
  8869. d *Decoder) (_ map[int64]float32, changed bool) {
  8870. containerLen := d.mapStart()
  8871. if canChange && v == nil {
  8872. v = make(map[int64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8873. changed = true
  8874. }
  8875. if containerLen == 0 {
  8876. d.mapEnd()
  8877. return v, changed
  8878. }
  8879. var mk int64
  8880. var mv float32
  8881. hasLen := containerLen > 0
  8882. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8883. d.mapElemKey()
  8884. mk = d.d.DecodeInt64()
  8885. d.mapElemValue()
  8886. if d.d.TryDecodeAsNil() {
  8887. if v == nil {
  8888. } else if d.h.DeleteOnNilMapValue {
  8889. delete(v, mk)
  8890. } else {
  8891. v[mk] = 0
  8892. }
  8893. continue
  8894. }
  8895. mv = float32(d.decodeFloat32())
  8896. if v != nil {
  8897. v[mk] = mv
  8898. }
  8899. }
  8900. d.mapEnd()
  8901. return v, changed
  8902. }
  8903. func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  8904. if rv.Kind() == reflect.Ptr {
  8905. vp := rv2i(rv).(*map[int64]float64)
  8906. if v, changed := fastpathTV.DecMapInt64Float64V(*vp, true, d); changed {
  8907. *vp = v
  8908. }
  8909. } else {
  8910. fastpathTV.DecMapInt64Float64V(rv2i(rv).(map[int64]float64), false, d)
  8911. }
  8912. }
  8913. func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) {
  8914. if v, changed := f.DecMapInt64Float64V(*vp, true, d); changed {
  8915. *vp = v
  8916. }
  8917. }
  8918. func (fastpathT) DecMapInt64Float64V(v map[int64]float64, canChange bool,
  8919. d *Decoder) (_ map[int64]float64, changed bool) {
  8920. containerLen := d.mapStart()
  8921. if canChange && v == nil {
  8922. v = make(map[int64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8923. changed = true
  8924. }
  8925. if containerLen == 0 {
  8926. d.mapEnd()
  8927. return v, changed
  8928. }
  8929. var mk int64
  8930. var mv float64
  8931. hasLen := containerLen > 0
  8932. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8933. d.mapElemKey()
  8934. mk = d.d.DecodeInt64()
  8935. d.mapElemValue()
  8936. if d.d.TryDecodeAsNil() {
  8937. if v == nil {
  8938. } else if d.h.DeleteOnNilMapValue {
  8939. delete(v, mk)
  8940. } else {
  8941. v[mk] = 0
  8942. }
  8943. continue
  8944. }
  8945. mv = d.d.DecodeFloat64()
  8946. if v != nil {
  8947. v[mk] = mv
  8948. }
  8949. }
  8950. d.mapEnd()
  8951. return v, changed
  8952. }
  8953. func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  8954. if rv.Kind() == reflect.Ptr {
  8955. vp := rv2i(rv).(*map[int64]bool)
  8956. if v, changed := fastpathTV.DecMapInt64BoolV(*vp, true, d); changed {
  8957. *vp = v
  8958. }
  8959. } else {
  8960. fastpathTV.DecMapInt64BoolV(rv2i(rv).(map[int64]bool), false, d)
  8961. }
  8962. }
  8963. func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) {
  8964. if v, changed := f.DecMapInt64BoolV(*vp, true, d); changed {
  8965. *vp = v
  8966. }
  8967. }
  8968. func (fastpathT) DecMapInt64BoolV(v map[int64]bool, canChange bool,
  8969. d *Decoder) (_ map[int64]bool, changed bool) {
  8970. containerLen := d.mapStart()
  8971. if canChange && v == nil {
  8972. v = make(map[int64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8973. changed = true
  8974. }
  8975. if containerLen == 0 {
  8976. d.mapEnd()
  8977. return v, changed
  8978. }
  8979. var mk int64
  8980. var mv bool
  8981. hasLen := containerLen > 0
  8982. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8983. d.mapElemKey()
  8984. mk = d.d.DecodeInt64()
  8985. d.mapElemValue()
  8986. if d.d.TryDecodeAsNil() {
  8987. if v == nil {
  8988. } else if d.h.DeleteOnNilMapValue {
  8989. delete(v, mk)
  8990. } else {
  8991. v[mk] = false
  8992. }
  8993. continue
  8994. }
  8995. mv = d.d.DecodeBool()
  8996. if v != nil {
  8997. v[mk] = mv
  8998. }
  8999. }
  9000. d.mapEnd()
  9001. return v, changed
  9002. }