fast-path.generated.go 237 KB

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