fast-path.generated.go 266 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827
  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 then 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,
  18. // - map of all builtin types to string or interface value
  19. // - symmetrical maps of all builtin types (e.g. str-str, uint8-uint8)
  20. // This should provide adequate "typical" implementations.
  21. //
  22. // Note that fast track decode functions must handle values for which an address cannot be obtained.
  23. // For example:
  24. // m2 := map[string]int{}
  25. // p2 := []interface{}{m2}
  26. // // decoding into p2 will bomb if fast track functions do not treat like unaddressable.
  27. //
  28. import (
  29. "reflect"
  30. "sort"
  31. )
  32. const fastpathEnabled = true
  33. const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v"
  34. type fastpathT struct{}
  35. var fastpathTV fastpathT
  36. type fastpathE struct {
  37. rtid uintptr
  38. rt reflect.Type
  39. encfn func(*Encoder, *codecFnInfo, reflect.Value)
  40. decfn func(*Decoder, *codecFnInfo, reflect.Value)
  41. }
  42. type fastpathA [92]fastpathE
  43. func (x *fastpathA) index(rtid uintptr) int {
  44. // use binary search to grab the index (adapted from sort/search.go)
  45. // Note: we use goto (instead of for loop) so this can be inlined.
  46. // h, i, j := 0, 0, len(x)
  47. var h, i uint
  48. var j = uint(len(x))
  49. LOOP:
  50. if i < j {
  51. h = i + (j-i)/2
  52. if x[h].rtid < rtid {
  53. i = h + 1
  54. } else {
  55. j = h
  56. }
  57. goto LOOP
  58. }
  59. if i < uint(len(x)) && x[i].rtid == rtid {
  60. return int(i)
  61. }
  62. return -1
  63. }
  64. type fastpathAslice []fastpathE
  65. func (x fastpathAslice) Len() int { return len(x) }
  66. func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid }
  67. func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] }
  68. var fastpathAV fastpathA
  69. // due to possible initialization loop error, make fastpath in an init()
  70. func init() {
  71. var i uint = 0
  72. fn := func(v interface{},
  73. fe func(*Encoder, *codecFnInfo, reflect.Value),
  74. fd func(*Decoder, *codecFnInfo, reflect.Value)) {
  75. xrt := reflect.TypeOf(v)
  76. xptr := rt2id(xrt)
  77. fastpathAV[i] = fastpathE{xptr, xrt, fe, fd}
  78. i++
  79. }
  80. fn([]interface{}(nil), (*Encoder).fastpathEncSliceIntfR, (*Decoder).fastpathDecSliceIntfR)
  81. fn([]string(nil), (*Encoder).fastpathEncSliceStringR, (*Decoder).fastpathDecSliceStringR)
  82. fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R)
  83. fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R)
  84. fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR)
  85. fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R)
  86. fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R)
  87. fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R)
  88. fn([]uintptr(nil), (*Encoder).fastpathEncSliceUintptrR, (*Decoder).fastpathDecSliceUintptrR)
  89. fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR)
  90. fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R)
  91. fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R)
  92. fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R)
  93. fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R)
  94. fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR)
  95. fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR)
  96. fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR)
  97. fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR)
  98. fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R)
  99. fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R)
  100. fn(map[string]uintptr(nil), (*Encoder).fastpathEncMapStringUintptrR, (*Decoder).fastpathDecMapStringUintptrR)
  101. fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR)
  102. fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R)
  103. fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R)
  104. fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R)
  105. fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR)
  106. fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR)
  107. fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR)
  108. fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR)
  109. fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R)
  110. fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R)
  111. fn(map[uint]uintptr(nil), (*Encoder).fastpathEncMapUintUintptrR, (*Decoder).fastpathDecMapUintUintptrR)
  112. fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR)
  113. fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R)
  114. fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R)
  115. fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R)
  116. fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR)
  117. fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR)
  118. fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR)
  119. fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR)
  120. fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R)
  121. fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R)
  122. fn(map[uint8]uintptr(nil), (*Encoder).fastpathEncMapUint8UintptrR, (*Decoder).fastpathDecMapUint8UintptrR)
  123. fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR)
  124. fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R)
  125. fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R)
  126. fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R)
  127. fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR)
  128. fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR)
  129. fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR)
  130. fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR)
  131. fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R)
  132. fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R)
  133. fn(map[uint64]uintptr(nil), (*Encoder).fastpathEncMapUint64UintptrR, (*Decoder).fastpathDecMapUint64UintptrR)
  134. fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR)
  135. fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R)
  136. fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R)
  137. fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R)
  138. fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR)
  139. fn(map[uintptr]interface{}(nil), (*Encoder).fastpathEncMapUintptrIntfR, (*Decoder).fastpathDecMapUintptrIntfR)
  140. fn(map[uintptr]string(nil), (*Encoder).fastpathEncMapUintptrStringR, (*Decoder).fastpathDecMapUintptrStringR)
  141. fn(map[uintptr]uint(nil), (*Encoder).fastpathEncMapUintptrUintR, (*Decoder).fastpathDecMapUintptrUintR)
  142. fn(map[uintptr]uint8(nil), (*Encoder).fastpathEncMapUintptrUint8R, (*Decoder).fastpathDecMapUintptrUint8R)
  143. fn(map[uintptr]uint64(nil), (*Encoder).fastpathEncMapUintptrUint64R, (*Decoder).fastpathDecMapUintptrUint64R)
  144. fn(map[uintptr]uintptr(nil), (*Encoder).fastpathEncMapUintptrUintptrR, (*Decoder).fastpathDecMapUintptrUintptrR)
  145. fn(map[uintptr]int(nil), (*Encoder).fastpathEncMapUintptrIntR, (*Decoder).fastpathDecMapUintptrIntR)
  146. fn(map[uintptr]int64(nil), (*Encoder).fastpathEncMapUintptrInt64R, (*Decoder).fastpathDecMapUintptrInt64R)
  147. fn(map[uintptr]float32(nil), (*Encoder).fastpathEncMapUintptrFloat32R, (*Decoder).fastpathDecMapUintptrFloat32R)
  148. fn(map[uintptr]float64(nil), (*Encoder).fastpathEncMapUintptrFloat64R, (*Decoder).fastpathDecMapUintptrFloat64R)
  149. fn(map[uintptr]bool(nil), (*Encoder).fastpathEncMapUintptrBoolR, (*Decoder).fastpathDecMapUintptrBoolR)
  150. fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR)
  151. fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR)
  152. fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR)
  153. fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R)
  154. fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R)
  155. fn(map[int]uintptr(nil), (*Encoder).fastpathEncMapIntUintptrR, (*Decoder).fastpathDecMapIntUintptrR)
  156. fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR)
  157. fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R)
  158. fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R)
  159. fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R)
  160. fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR)
  161. fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR)
  162. fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR)
  163. fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR)
  164. fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R)
  165. fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R)
  166. fn(map[int64]uintptr(nil), (*Encoder).fastpathEncMapInt64UintptrR, (*Decoder).fastpathDecMapInt64UintptrR)
  167. fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR)
  168. fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R)
  169. fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R)
  170. fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R)
  171. fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR)
  172. sort.Sort(fastpathAslice(fastpathAV[:]))
  173. }
  174. // -- encode
  175. // -- -- fast path type switch
  176. func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
  177. switch v := iv.(type) {
  178. case []interface{}:
  179. fastpathTV.EncSliceIntfV(v, e)
  180. case *[]interface{}:
  181. fastpathTV.EncSliceIntfV(*v, e)
  182. case []string:
  183. fastpathTV.EncSliceStringV(v, e)
  184. case *[]string:
  185. fastpathTV.EncSliceStringV(*v, e)
  186. case []float32:
  187. fastpathTV.EncSliceFloat32V(v, e)
  188. case *[]float32:
  189. fastpathTV.EncSliceFloat32V(*v, e)
  190. case []float64:
  191. fastpathTV.EncSliceFloat64V(v, e)
  192. case *[]float64:
  193. fastpathTV.EncSliceFloat64V(*v, e)
  194. case []uint:
  195. fastpathTV.EncSliceUintV(v, e)
  196. case *[]uint:
  197. fastpathTV.EncSliceUintV(*v, e)
  198. case []uint16:
  199. fastpathTV.EncSliceUint16V(v, e)
  200. case *[]uint16:
  201. fastpathTV.EncSliceUint16V(*v, e)
  202. case []uint32:
  203. fastpathTV.EncSliceUint32V(v, e)
  204. case *[]uint32:
  205. fastpathTV.EncSliceUint32V(*v, e)
  206. case []uint64:
  207. fastpathTV.EncSliceUint64V(v, e)
  208. case *[]uint64:
  209. fastpathTV.EncSliceUint64V(*v, e)
  210. case []uintptr:
  211. fastpathTV.EncSliceUintptrV(v, e)
  212. case *[]uintptr:
  213. fastpathTV.EncSliceUintptrV(*v, e)
  214. case []int:
  215. fastpathTV.EncSliceIntV(v, e)
  216. case *[]int:
  217. fastpathTV.EncSliceIntV(*v, e)
  218. case []int8:
  219. fastpathTV.EncSliceInt8V(v, e)
  220. case *[]int8:
  221. fastpathTV.EncSliceInt8V(*v, e)
  222. case []int16:
  223. fastpathTV.EncSliceInt16V(v, e)
  224. case *[]int16:
  225. fastpathTV.EncSliceInt16V(*v, e)
  226. case []int32:
  227. fastpathTV.EncSliceInt32V(v, e)
  228. case *[]int32:
  229. fastpathTV.EncSliceInt32V(*v, e)
  230. case []int64:
  231. fastpathTV.EncSliceInt64V(v, e)
  232. case *[]int64:
  233. fastpathTV.EncSliceInt64V(*v, e)
  234. case []bool:
  235. fastpathTV.EncSliceBoolV(v, e)
  236. case *[]bool:
  237. fastpathTV.EncSliceBoolV(*v, e)
  238. case map[string]interface{}:
  239. fastpathTV.EncMapStringIntfV(v, e)
  240. case *map[string]interface{}:
  241. fastpathTV.EncMapStringIntfV(*v, e)
  242. case map[string]string:
  243. fastpathTV.EncMapStringStringV(v, e)
  244. case *map[string]string:
  245. fastpathTV.EncMapStringStringV(*v, e)
  246. case map[string]uint:
  247. fastpathTV.EncMapStringUintV(v, e)
  248. case *map[string]uint:
  249. fastpathTV.EncMapStringUintV(*v, e)
  250. case map[string]uint8:
  251. fastpathTV.EncMapStringUint8V(v, e)
  252. case *map[string]uint8:
  253. fastpathTV.EncMapStringUint8V(*v, e)
  254. case map[string]uint64:
  255. fastpathTV.EncMapStringUint64V(v, e)
  256. case *map[string]uint64:
  257. fastpathTV.EncMapStringUint64V(*v, e)
  258. case map[string]uintptr:
  259. fastpathTV.EncMapStringUintptrV(v, e)
  260. case *map[string]uintptr:
  261. fastpathTV.EncMapStringUintptrV(*v, e)
  262. case map[string]int:
  263. fastpathTV.EncMapStringIntV(v, e)
  264. case *map[string]int:
  265. fastpathTV.EncMapStringIntV(*v, e)
  266. case map[string]int64:
  267. fastpathTV.EncMapStringInt64V(v, e)
  268. case *map[string]int64:
  269. fastpathTV.EncMapStringInt64V(*v, e)
  270. case map[string]float32:
  271. fastpathTV.EncMapStringFloat32V(v, e)
  272. case *map[string]float32:
  273. fastpathTV.EncMapStringFloat32V(*v, e)
  274. case map[string]float64:
  275. fastpathTV.EncMapStringFloat64V(v, e)
  276. case *map[string]float64:
  277. fastpathTV.EncMapStringFloat64V(*v, e)
  278. case map[string]bool:
  279. fastpathTV.EncMapStringBoolV(v, e)
  280. case *map[string]bool:
  281. fastpathTV.EncMapStringBoolV(*v, e)
  282. case map[uint]interface{}:
  283. fastpathTV.EncMapUintIntfV(v, e)
  284. case *map[uint]interface{}:
  285. fastpathTV.EncMapUintIntfV(*v, e)
  286. case map[uint]string:
  287. fastpathTV.EncMapUintStringV(v, e)
  288. case *map[uint]string:
  289. fastpathTV.EncMapUintStringV(*v, e)
  290. case map[uint]uint:
  291. fastpathTV.EncMapUintUintV(v, e)
  292. case *map[uint]uint:
  293. fastpathTV.EncMapUintUintV(*v, e)
  294. case map[uint]uint8:
  295. fastpathTV.EncMapUintUint8V(v, e)
  296. case *map[uint]uint8:
  297. fastpathTV.EncMapUintUint8V(*v, e)
  298. case map[uint]uint64:
  299. fastpathTV.EncMapUintUint64V(v, e)
  300. case *map[uint]uint64:
  301. fastpathTV.EncMapUintUint64V(*v, e)
  302. case map[uint]uintptr:
  303. fastpathTV.EncMapUintUintptrV(v, e)
  304. case *map[uint]uintptr:
  305. fastpathTV.EncMapUintUintptrV(*v, e)
  306. case map[uint]int:
  307. fastpathTV.EncMapUintIntV(v, e)
  308. case *map[uint]int:
  309. fastpathTV.EncMapUintIntV(*v, e)
  310. case map[uint]int64:
  311. fastpathTV.EncMapUintInt64V(v, e)
  312. case *map[uint]int64:
  313. fastpathTV.EncMapUintInt64V(*v, e)
  314. case map[uint]float32:
  315. fastpathTV.EncMapUintFloat32V(v, e)
  316. case *map[uint]float32:
  317. fastpathTV.EncMapUintFloat32V(*v, e)
  318. case map[uint]float64:
  319. fastpathTV.EncMapUintFloat64V(v, e)
  320. case *map[uint]float64:
  321. fastpathTV.EncMapUintFloat64V(*v, e)
  322. case map[uint]bool:
  323. fastpathTV.EncMapUintBoolV(v, e)
  324. case *map[uint]bool:
  325. fastpathTV.EncMapUintBoolV(*v, e)
  326. case map[uint8]interface{}:
  327. fastpathTV.EncMapUint8IntfV(v, e)
  328. case *map[uint8]interface{}:
  329. fastpathTV.EncMapUint8IntfV(*v, e)
  330. case map[uint8]string:
  331. fastpathTV.EncMapUint8StringV(v, e)
  332. case *map[uint8]string:
  333. fastpathTV.EncMapUint8StringV(*v, e)
  334. case map[uint8]uint:
  335. fastpathTV.EncMapUint8UintV(v, e)
  336. case *map[uint8]uint:
  337. fastpathTV.EncMapUint8UintV(*v, e)
  338. case map[uint8]uint8:
  339. fastpathTV.EncMapUint8Uint8V(v, e)
  340. case *map[uint8]uint8:
  341. fastpathTV.EncMapUint8Uint8V(*v, e)
  342. case map[uint8]uint64:
  343. fastpathTV.EncMapUint8Uint64V(v, e)
  344. case *map[uint8]uint64:
  345. fastpathTV.EncMapUint8Uint64V(*v, e)
  346. case map[uint8]uintptr:
  347. fastpathTV.EncMapUint8UintptrV(v, e)
  348. case *map[uint8]uintptr:
  349. fastpathTV.EncMapUint8UintptrV(*v, e)
  350. case map[uint8]int:
  351. fastpathTV.EncMapUint8IntV(v, e)
  352. case *map[uint8]int:
  353. fastpathTV.EncMapUint8IntV(*v, e)
  354. case map[uint8]int64:
  355. fastpathTV.EncMapUint8Int64V(v, e)
  356. case *map[uint8]int64:
  357. fastpathTV.EncMapUint8Int64V(*v, e)
  358. case map[uint8]float32:
  359. fastpathTV.EncMapUint8Float32V(v, e)
  360. case *map[uint8]float32:
  361. fastpathTV.EncMapUint8Float32V(*v, e)
  362. case map[uint8]float64:
  363. fastpathTV.EncMapUint8Float64V(v, e)
  364. case *map[uint8]float64:
  365. fastpathTV.EncMapUint8Float64V(*v, e)
  366. case map[uint8]bool:
  367. fastpathTV.EncMapUint8BoolV(v, e)
  368. case *map[uint8]bool:
  369. fastpathTV.EncMapUint8BoolV(*v, e)
  370. case map[uint64]interface{}:
  371. fastpathTV.EncMapUint64IntfV(v, e)
  372. case *map[uint64]interface{}:
  373. fastpathTV.EncMapUint64IntfV(*v, e)
  374. case map[uint64]string:
  375. fastpathTV.EncMapUint64StringV(v, e)
  376. case *map[uint64]string:
  377. fastpathTV.EncMapUint64StringV(*v, e)
  378. case map[uint64]uint:
  379. fastpathTV.EncMapUint64UintV(v, e)
  380. case *map[uint64]uint:
  381. fastpathTV.EncMapUint64UintV(*v, e)
  382. case map[uint64]uint8:
  383. fastpathTV.EncMapUint64Uint8V(v, e)
  384. case *map[uint64]uint8:
  385. fastpathTV.EncMapUint64Uint8V(*v, e)
  386. case map[uint64]uint64:
  387. fastpathTV.EncMapUint64Uint64V(v, e)
  388. case *map[uint64]uint64:
  389. fastpathTV.EncMapUint64Uint64V(*v, e)
  390. case map[uint64]uintptr:
  391. fastpathTV.EncMapUint64UintptrV(v, e)
  392. case *map[uint64]uintptr:
  393. fastpathTV.EncMapUint64UintptrV(*v, e)
  394. case map[uint64]int:
  395. fastpathTV.EncMapUint64IntV(v, e)
  396. case *map[uint64]int:
  397. fastpathTV.EncMapUint64IntV(*v, e)
  398. case map[uint64]int64:
  399. fastpathTV.EncMapUint64Int64V(v, e)
  400. case *map[uint64]int64:
  401. fastpathTV.EncMapUint64Int64V(*v, e)
  402. case map[uint64]float32:
  403. fastpathTV.EncMapUint64Float32V(v, e)
  404. case *map[uint64]float32:
  405. fastpathTV.EncMapUint64Float32V(*v, e)
  406. case map[uint64]float64:
  407. fastpathTV.EncMapUint64Float64V(v, e)
  408. case *map[uint64]float64:
  409. fastpathTV.EncMapUint64Float64V(*v, e)
  410. case map[uint64]bool:
  411. fastpathTV.EncMapUint64BoolV(v, e)
  412. case *map[uint64]bool:
  413. fastpathTV.EncMapUint64BoolV(*v, e)
  414. case map[uintptr]interface{}:
  415. fastpathTV.EncMapUintptrIntfV(v, e)
  416. case *map[uintptr]interface{}:
  417. fastpathTV.EncMapUintptrIntfV(*v, e)
  418. case map[uintptr]string:
  419. fastpathTV.EncMapUintptrStringV(v, e)
  420. case *map[uintptr]string:
  421. fastpathTV.EncMapUintptrStringV(*v, e)
  422. case map[uintptr]uint:
  423. fastpathTV.EncMapUintptrUintV(v, e)
  424. case *map[uintptr]uint:
  425. fastpathTV.EncMapUintptrUintV(*v, e)
  426. case map[uintptr]uint8:
  427. fastpathTV.EncMapUintptrUint8V(v, e)
  428. case *map[uintptr]uint8:
  429. fastpathTV.EncMapUintptrUint8V(*v, e)
  430. case map[uintptr]uint64:
  431. fastpathTV.EncMapUintptrUint64V(v, e)
  432. case *map[uintptr]uint64:
  433. fastpathTV.EncMapUintptrUint64V(*v, e)
  434. case map[uintptr]uintptr:
  435. fastpathTV.EncMapUintptrUintptrV(v, e)
  436. case *map[uintptr]uintptr:
  437. fastpathTV.EncMapUintptrUintptrV(*v, e)
  438. case map[uintptr]int:
  439. fastpathTV.EncMapUintptrIntV(v, e)
  440. case *map[uintptr]int:
  441. fastpathTV.EncMapUintptrIntV(*v, e)
  442. case map[uintptr]int64:
  443. fastpathTV.EncMapUintptrInt64V(v, e)
  444. case *map[uintptr]int64:
  445. fastpathTV.EncMapUintptrInt64V(*v, e)
  446. case map[uintptr]float32:
  447. fastpathTV.EncMapUintptrFloat32V(v, e)
  448. case *map[uintptr]float32:
  449. fastpathTV.EncMapUintptrFloat32V(*v, e)
  450. case map[uintptr]float64:
  451. fastpathTV.EncMapUintptrFloat64V(v, e)
  452. case *map[uintptr]float64:
  453. fastpathTV.EncMapUintptrFloat64V(*v, e)
  454. case map[uintptr]bool:
  455. fastpathTV.EncMapUintptrBoolV(v, e)
  456. case *map[uintptr]bool:
  457. fastpathTV.EncMapUintptrBoolV(*v, e)
  458. case map[int]interface{}:
  459. fastpathTV.EncMapIntIntfV(v, e)
  460. case *map[int]interface{}:
  461. fastpathTV.EncMapIntIntfV(*v, e)
  462. case map[int]string:
  463. fastpathTV.EncMapIntStringV(v, e)
  464. case *map[int]string:
  465. fastpathTV.EncMapIntStringV(*v, e)
  466. case map[int]uint:
  467. fastpathTV.EncMapIntUintV(v, e)
  468. case *map[int]uint:
  469. fastpathTV.EncMapIntUintV(*v, e)
  470. case map[int]uint8:
  471. fastpathTV.EncMapIntUint8V(v, e)
  472. case *map[int]uint8:
  473. fastpathTV.EncMapIntUint8V(*v, e)
  474. case map[int]uint64:
  475. fastpathTV.EncMapIntUint64V(v, e)
  476. case *map[int]uint64:
  477. fastpathTV.EncMapIntUint64V(*v, e)
  478. case map[int]uintptr:
  479. fastpathTV.EncMapIntUintptrV(v, e)
  480. case *map[int]uintptr:
  481. fastpathTV.EncMapIntUintptrV(*v, e)
  482. case map[int]int:
  483. fastpathTV.EncMapIntIntV(v, e)
  484. case *map[int]int:
  485. fastpathTV.EncMapIntIntV(*v, e)
  486. case map[int]int64:
  487. fastpathTV.EncMapIntInt64V(v, e)
  488. case *map[int]int64:
  489. fastpathTV.EncMapIntInt64V(*v, e)
  490. case map[int]float32:
  491. fastpathTV.EncMapIntFloat32V(v, e)
  492. case *map[int]float32:
  493. fastpathTV.EncMapIntFloat32V(*v, e)
  494. case map[int]float64:
  495. fastpathTV.EncMapIntFloat64V(v, e)
  496. case *map[int]float64:
  497. fastpathTV.EncMapIntFloat64V(*v, e)
  498. case map[int]bool:
  499. fastpathTV.EncMapIntBoolV(v, e)
  500. case *map[int]bool:
  501. fastpathTV.EncMapIntBoolV(*v, e)
  502. case map[int64]interface{}:
  503. fastpathTV.EncMapInt64IntfV(v, e)
  504. case *map[int64]interface{}:
  505. fastpathTV.EncMapInt64IntfV(*v, e)
  506. case map[int64]string:
  507. fastpathTV.EncMapInt64StringV(v, e)
  508. case *map[int64]string:
  509. fastpathTV.EncMapInt64StringV(*v, e)
  510. case map[int64]uint:
  511. fastpathTV.EncMapInt64UintV(v, e)
  512. case *map[int64]uint:
  513. fastpathTV.EncMapInt64UintV(*v, e)
  514. case map[int64]uint8:
  515. fastpathTV.EncMapInt64Uint8V(v, e)
  516. case *map[int64]uint8:
  517. fastpathTV.EncMapInt64Uint8V(*v, e)
  518. case map[int64]uint64:
  519. fastpathTV.EncMapInt64Uint64V(v, e)
  520. case *map[int64]uint64:
  521. fastpathTV.EncMapInt64Uint64V(*v, e)
  522. case map[int64]uintptr:
  523. fastpathTV.EncMapInt64UintptrV(v, e)
  524. case *map[int64]uintptr:
  525. fastpathTV.EncMapInt64UintptrV(*v, e)
  526. case map[int64]int:
  527. fastpathTV.EncMapInt64IntV(v, e)
  528. case *map[int64]int:
  529. fastpathTV.EncMapInt64IntV(*v, e)
  530. case map[int64]int64:
  531. fastpathTV.EncMapInt64Int64V(v, e)
  532. case *map[int64]int64:
  533. fastpathTV.EncMapInt64Int64V(*v, e)
  534. case map[int64]float32:
  535. fastpathTV.EncMapInt64Float32V(v, e)
  536. case *map[int64]float32:
  537. fastpathTV.EncMapInt64Float32V(*v, e)
  538. case map[int64]float64:
  539. fastpathTV.EncMapInt64Float64V(v, e)
  540. case *map[int64]float64:
  541. fastpathTV.EncMapInt64Float64V(*v, e)
  542. case map[int64]bool:
  543. fastpathTV.EncMapInt64BoolV(v, e)
  544. case *map[int64]bool:
  545. fastpathTV.EncMapInt64BoolV(*v, e)
  546. default:
  547. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  548. return false
  549. }
  550. return true
  551. }
  552. // -- -- fast path functions
  553. func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  554. if f.ti.mbs {
  555. fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e)
  556. } else {
  557. fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e)
  558. }
  559. }
  560. func (fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) {
  561. if v == nil {
  562. e.e.EncodeNil()
  563. return
  564. }
  565. e.e.WriteArrayStart(len(v))
  566. for _, v2 := range v {
  567. if e.esep {
  568. e.e.WriteArrayElem()
  569. }
  570. e.encode(v2)
  571. }
  572. e.e.WriteArrayEnd()
  573. }
  574. func (fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) {
  575. if len(v)%2 == 1 {
  576. e.errorf(fastpathMapBySliceErrMsg, len(v))
  577. return
  578. }
  579. e.e.WriteMapStart(len(v) / 2)
  580. for j, v2 := range v {
  581. if e.esep {
  582. if j%2 == 0 {
  583. e.e.WriteMapElemKey()
  584. } else {
  585. e.e.WriteMapElemValue()
  586. }
  587. }
  588. e.encode(v2)
  589. }
  590. e.e.WriteMapEnd()
  591. }
  592. func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) {
  593. if f.ti.mbs {
  594. fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e)
  595. } else {
  596. fastpathTV.EncSliceStringV(rv2i(rv).([]string), e)
  597. }
  598. }
  599. func (fastpathT) EncSliceStringV(v []string, e *Encoder) {
  600. if v == nil {
  601. e.e.EncodeNil()
  602. return
  603. }
  604. e.e.WriteArrayStart(len(v))
  605. for _, v2 := range v {
  606. if e.esep {
  607. e.e.WriteArrayElem()
  608. }
  609. if e.h.StringToRaw {
  610. e.e.EncodeStringBytesRaw(bytesView(v2))
  611. } else {
  612. e.e.EncodeStringEnc(cUTF8, v2)
  613. }
  614. }
  615. e.e.WriteArrayEnd()
  616. }
  617. func (fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) {
  618. if len(v)%2 == 1 {
  619. e.errorf(fastpathMapBySliceErrMsg, len(v))
  620. return
  621. }
  622. e.e.WriteMapStart(len(v) / 2)
  623. for j, v2 := range v {
  624. if e.esep {
  625. if j%2 == 0 {
  626. e.e.WriteMapElemKey()
  627. } else {
  628. e.e.WriteMapElemValue()
  629. }
  630. }
  631. if e.h.StringToRaw {
  632. e.e.EncodeStringBytesRaw(bytesView(v2))
  633. } else {
  634. e.e.EncodeStringEnc(cUTF8, v2)
  635. }
  636. }
  637. e.e.WriteMapEnd()
  638. }
  639. func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  640. if f.ti.mbs {
  641. fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e)
  642. } else {
  643. fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e)
  644. }
  645. }
  646. func (fastpathT) EncSliceFloat32V(v []float32, e *Encoder) {
  647. if v == nil {
  648. e.e.EncodeNil()
  649. return
  650. }
  651. e.e.WriteArrayStart(len(v))
  652. for _, v2 := range v {
  653. if e.esep {
  654. e.e.WriteArrayElem()
  655. }
  656. e.e.EncodeFloat32(v2)
  657. }
  658. e.e.WriteArrayEnd()
  659. }
  660. func (fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) {
  661. if len(v)%2 == 1 {
  662. e.errorf(fastpathMapBySliceErrMsg, len(v))
  663. return
  664. }
  665. e.e.WriteMapStart(len(v) / 2)
  666. for j, v2 := range v {
  667. if e.esep {
  668. if j%2 == 0 {
  669. e.e.WriteMapElemKey()
  670. } else {
  671. e.e.WriteMapElemValue()
  672. }
  673. }
  674. e.e.EncodeFloat32(v2)
  675. }
  676. e.e.WriteMapEnd()
  677. }
  678. func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  679. if f.ti.mbs {
  680. fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e)
  681. } else {
  682. fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e)
  683. }
  684. }
  685. func (fastpathT) EncSliceFloat64V(v []float64, e *Encoder) {
  686. if v == nil {
  687. e.e.EncodeNil()
  688. return
  689. }
  690. e.e.WriteArrayStart(len(v))
  691. for _, v2 := range v {
  692. if e.esep {
  693. e.e.WriteArrayElem()
  694. }
  695. e.e.EncodeFloat64(v2)
  696. }
  697. e.e.WriteArrayEnd()
  698. }
  699. func (fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) {
  700. if len(v)%2 == 1 {
  701. e.errorf(fastpathMapBySliceErrMsg, len(v))
  702. return
  703. }
  704. e.e.WriteMapStart(len(v) / 2)
  705. for j, v2 := range v {
  706. if e.esep {
  707. if j%2 == 0 {
  708. e.e.WriteMapElemKey()
  709. } else {
  710. e.e.WriteMapElemValue()
  711. }
  712. }
  713. e.e.EncodeFloat64(v2)
  714. }
  715. e.e.WriteMapEnd()
  716. }
  717. func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) {
  718. if f.ti.mbs {
  719. fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e)
  720. } else {
  721. fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e)
  722. }
  723. }
  724. func (fastpathT) EncSliceUintV(v []uint, e *Encoder) {
  725. if v == nil {
  726. e.e.EncodeNil()
  727. return
  728. }
  729. e.e.WriteArrayStart(len(v))
  730. for _, v2 := range v {
  731. if e.esep {
  732. e.e.WriteArrayElem()
  733. }
  734. e.e.EncodeUint(uint64(v2))
  735. }
  736. e.e.WriteArrayEnd()
  737. }
  738. func (fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) {
  739. if len(v)%2 == 1 {
  740. e.errorf(fastpathMapBySliceErrMsg, len(v))
  741. return
  742. }
  743. e.e.WriteMapStart(len(v) / 2)
  744. for j, v2 := range v {
  745. if e.esep {
  746. if j%2 == 0 {
  747. e.e.WriteMapElemKey()
  748. } else {
  749. e.e.WriteMapElemValue()
  750. }
  751. }
  752. e.e.EncodeUint(uint64(v2))
  753. }
  754. e.e.WriteMapEnd()
  755. }
  756. func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) {
  757. if f.ti.mbs {
  758. fastpathTV.EncAsMapSliceUint8V(rv2i(rv).([]uint8), e)
  759. } else {
  760. fastpathTV.EncSliceUint8V(rv2i(rv).([]uint8), e)
  761. }
  762. }
  763. func (fastpathT) EncSliceUint8V(v []uint8, e *Encoder) {
  764. if v == nil {
  765. e.e.EncodeNil()
  766. return
  767. }
  768. e.e.WriteArrayStart(len(v))
  769. for _, v2 := range v {
  770. if e.esep {
  771. e.e.WriteArrayElem()
  772. }
  773. e.e.EncodeUint(uint64(v2))
  774. }
  775. e.e.WriteArrayEnd()
  776. }
  777. func (fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) {
  778. if len(v)%2 == 1 {
  779. e.errorf(fastpathMapBySliceErrMsg, len(v))
  780. return
  781. }
  782. e.e.WriteMapStart(len(v) / 2)
  783. for j, v2 := range v {
  784. if e.esep {
  785. if j%2 == 0 {
  786. e.e.WriteMapElemKey()
  787. } else {
  788. e.e.WriteMapElemValue()
  789. }
  790. }
  791. e.e.EncodeUint(uint64(v2))
  792. }
  793. e.e.WriteMapEnd()
  794. }
  795. func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  796. if f.ti.mbs {
  797. fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e)
  798. } else {
  799. fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e)
  800. }
  801. }
  802. func (fastpathT) EncSliceUint16V(v []uint16, e *Encoder) {
  803. if v == nil {
  804. e.e.EncodeNil()
  805. return
  806. }
  807. e.e.WriteArrayStart(len(v))
  808. for _, v2 := range v {
  809. if e.esep {
  810. e.e.WriteArrayElem()
  811. }
  812. e.e.EncodeUint(uint64(v2))
  813. }
  814. e.e.WriteArrayEnd()
  815. }
  816. func (fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) {
  817. if len(v)%2 == 1 {
  818. e.errorf(fastpathMapBySliceErrMsg, len(v))
  819. return
  820. }
  821. e.e.WriteMapStart(len(v) / 2)
  822. for j, v2 := range v {
  823. if e.esep {
  824. if j%2 == 0 {
  825. e.e.WriteMapElemKey()
  826. } else {
  827. e.e.WriteMapElemValue()
  828. }
  829. }
  830. e.e.EncodeUint(uint64(v2))
  831. }
  832. e.e.WriteMapEnd()
  833. }
  834. func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  835. if f.ti.mbs {
  836. fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e)
  837. } else {
  838. fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e)
  839. }
  840. }
  841. func (fastpathT) EncSliceUint32V(v []uint32, e *Encoder) {
  842. if v == nil {
  843. e.e.EncodeNil()
  844. return
  845. }
  846. e.e.WriteArrayStart(len(v))
  847. for _, v2 := range v {
  848. if e.esep {
  849. e.e.WriteArrayElem()
  850. }
  851. e.e.EncodeUint(uint64(v2))
  852. }
  853. e.e.WriteArrayEnd()
  854. }
  855. func (fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) {
  856. if len(v)%2 == 1 {
  857. e.errorf(fastpathMapBySliceErrMsg, len(v))
  858. return
  859. }
  860. e.e.WriteMapStart(len(v) / 2)
  861. for j, v2 := range v {
  862. if e.esep {
  863. if j%2 == 0 {
  864. e.e.WriteMapElemKey()
  865. } else {
  866. e.e.WriteMapElemValue()
  867. }
  868. }
  869. e.e.EncodeUint(uint64(v2))
  870. }
  871. e.e.WriteMapEnd()
  872. }
  873. func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  874. if f.ti.mbs {
  875. fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e)
  876. } else {
  877. fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e)
  878. }
  879. }
  880. func (fastpathT) EncSliceUint64V(v []uint64, e *Encoder) {
  881. if v == nil {
  882. e.e.EncodeNil()
  883. return
  884. }
  885. e.e.WriteArrayStart(len(v))
  886. for _, v2 := range v {
  887. if e.esep {
  888. e.e.WriteArrayElem()
  889. }
  890. e.e.EncodeUint(v2)
  891. }
  892. e.e.WriteArrayEnd()
  893. }
  894. func (fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) {
  895. if len(v)%2 == 1 {
  896. e.errorf(fastpathMapBySliceErrMsg, len(v))
  897. return
  898. }
  899. e.e.WriteMapStart(len(v) / 2)
  900. for j, v2 := range v {
  901. if e.esep {
  902. if j%2 == 0 {
  903. e.e.WriteMapElemKey()
  904. } else {
  905. e.e.WriteMapElemValue()
  906. }
  907. }
  908. e.e.EncodeUint(v2)
  909. }
  910. e.e.WriteMapEnd()
  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.e.WriteArrayStart(len(v))
  925. for _, v2 := range v {
  926. if e.esep {
  927. e.e.WriteArrayElem()
  928. }
  929. e.encode(v2)
  930. }
  931. e.e.WriteArrayEnd()
  932. }
  933. func (fastpathT) EncAsMapSliceUintptrV(v []uintptr, e *Encoder) {
  934. if len(v)%2 == 1 {
  935. e.errorf(fastpathMapBySliceErrMsg, len(v))
  936. return
  937. }
  938. e.e.WriteMapStart(len(v) / 2)
  939. for j, v2 := range v {
  940. if e.esep {
  941. if j%2 == 0 {
  942. e.e.WriteMapElemKey()
  943. } else {
  944. e.e.WriteMapElemValue()
  945. }
  946. }
  947. e.encode(v2)
  948. }
  949. e.e.WriteMapEnd()
  950. }
  951. func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) {
  952. if f.ti.mbs {
  953. fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e)
  954. } else {
  955. fastpathTV.EncSliceIntV(rv2i(rv).([]int), e)
  956. }
  957. }
  958. func (fastpathT) EncSliceIntV(v []int, e *Encoder) {
  959. if v == nil {
  960. e.e.EncodeNil()
  961. return
  962. }
  963. e.e.WriteArrayStart(len(v))
  964. for _, v2 := range v {
  965. if e.esep {
  966. e.e.WriteArrayElem()
  967. }
  968. e.e.EncodeInt(int64(v2))
  969. }
  970. e.e.WriteArrayEnd()
  971. }
  972. func (fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) {
  973. if len(v)%2 == 1 {
  974. e.errorf(fastpathMapBySliceErrMsg, len(v))
  975. return
  976. }
  977. e.e.WriteMapStart(len(v) / 2)
  978. for j, v2 := range v {
  979. if e.esep {
  980. if j%2 == 0 {
  981. e.e.WriteMapElemKey()
  982. } else {
  983. e.e.WriteMapElemValue()
  984. }
  985. }
  986. e.e.EncodeInt(int64(v2))
  987. }
  988. e.e.WriteMapEnd()
  989. }
  990. func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  991. if f.ti.mbs {
  992. fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e)
  993. } else {
  994. fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e)
  995. }
  996. }
  997. func (fastpathT) EncSliceInt8V(v []int8, e *Encoder) {
  998. if v == nil {
  999. e.e.EncodeNil()
  1000. return
  1001. }
  1002. e.e.WriteArrayStart(len(v))
  1003. for _, v2 := range v {
  1004. if e.esep {
  1005. e.e.WriteArrayElem()
  1006. }
  1007. e.e.EncodeInt(int64(v2))
  1008. }
  1009. e.e.WriteArrayEnd()
  1010. }
  1011. func (fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) {
  1012. if len(v)%2 == 1 {
  1013. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1014. return
  1015. }
  1016. e.e.WriteMapStart(len(v) / 2)
  1017. for j, v2 := range v {
  1018. if e.esep {
  1019. if j%2 == 0 {
  1020. e.e.WriteMapElemKey()
  1021. } else {
  1022. e.e.WriteMapElemValue()
  1023. }
  1024. }
  1025. e.e.EncodeInt(int64(v2))
  1026. }
  1027. e.e.WriteMapEnd()
  1028. }
  1029. func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  1030. if f.ti.mbs {
  1031. fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e)
  1032. } else {
  1033. fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e)
  1034. }
  1035. }
  1036. func (fastpathT) EncSliceInt16V(v []int16, e *Encoder) {
  1037. if v == nil {
  1038. e.e.EncodeNil()
  1039. return
  1040. }
  1041. e.e.WriteArrayStart(len(v))
  1042. for _, v2 := range v {
  1043. if e.esep {
  1044. e.e.WriteArrayElem()
  1045. }
  1046. e.e.EncodeInt(int64(v2))
  1047. }
  1048. e.e.WriteArrayEnd()
  1049. }
  1050. func (fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) {
  1051. if len(v)%2 == 1 {
  1052. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1053. return
  1054. }
  1055. e.e.WriteMapStart(len(v) / 2)
  1056. for j, v2 := range v {
  1057. if e.esep {
  1058. if j%2 == 0 {
  1059. e.e.WriteMapElemKey()
  1060. } else {
  1061. e.e.WriteMapElemValue()
  1062. }
  1063. }
  1064. e.e.EncodeInt(int64(v2))
  1065. }
  1066. e.e.WriteMapEnd()
  1067. }
  1068. func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  1069. if f.ti.mbs {
  1070. fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e)
  1071. } else {
  1072. fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e)
  1073. }
  1074. }
  1075. func (fastpathT) EncSliceInt32V(v []int32, e *Encoder) {
  1076. if v == nil {
  1077. e.e.EncodeNil()
  1078. return
  1079. }
  1080. e.e.WriteArrayStart(len(v))
  1081. for _, v2 := range v {
  1082. if e.esep {
  1083. e.e.WriteArrayElem()
  1084. }
  1085. e.e.EncodeInt(int64(v2))
  1086. }
  1087. e.e.WriteArrayEnd()
  1088. }
  1089. func (fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) {
  1090. if len(v)%2 == 1 {
  1091. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1092. return
  1093. }
  1094. e.e.WriteMapStart(len(v) / 2)
  1095. for j, v2 := range v {
  1096. if e.esep {
  1097. if j%2 == 0 {
  1098. e.e.WriteMapElemKey()
  1099. } else {
  1100. e.e.WriteMapElemValue()
  1101. }
  1102. }
  1103. e.e.EncodeInt(int64(v2))
  1104. }
  1105. e.e.WriteMapEnd()
  1106. }
  1107. func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  1108. if f.ti.mbs {
  1109. fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e)
  1110. } else {
  1111. fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e)
  1112. }
  1113. }
  1114. func (fastpathT) EncSliceInt64V(v []int64, e *Encoder) {
  1115. if v == nil {
  1116. e.e.EncodeNil()
  1117. return
  1118. }
  1119. e.e.WriteArrayStart(len(v))
  1120. for _, v2 := range v {
  1121. if e.esep {
  1122. e.e.WriteArrayElem()
  1123. }
  1124. e.e.EncodeInt(v2)
  1125. }
  1126. e.e.WriteArrayEnd()
  1127. }
  1128. func (fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) {
  1129. if len(v)%2 == 1 {
  1130. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1131. return
  1132. }
  1133. e.e.WriteMapStart(len(v) / 2)
  1134. for j, v2 := range v {
  1135. if e.esep {
  1136. if j%2 == 0 {
  1137. e.e.WriteMapElemKey()
  1138. } else {
  1139. e.e.WriteMapElemValue()
  1140. }
  1141. }
  1142. e.e.EncodeInt(v2)
  1143. }
  1144. e.e.WriteMapEnd()
  1145. }
  1146. func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  1147. if f.ti.mbs {
  1148. fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e)
  1149. } else {
  1150. fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e)
  1151. }
  1152. }
  1153. func (fastpathT) EncSliceBoolV(v []bool, e *Encoder) {
  1154. if v == nil {
  1155. e.e.EncodeNil()
  1156. return
  1157. }
  1158. e.e.WriteArrayStart(len(v))
  1159. for _, v2 := range v {
  1160. if e.esep {
  1161. e.e.WriteArrayElem()
  1162. }
  1163. e.e.EncodeBool(v2)
  1164. }
  1165. e.e.WriteArrayEnd()
  1166. }
  1167. func (fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) {
  1168. if len(v)%2 == 1 {
  1169. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1170. return
  1171. }
  1172. e.e.WriteMapStart(len(v) / 2)
  1173. for j, v2 := range v {
  1174. if e.esep {
  1175. if j%2 == 0 {
  1176. e.e.WriteMapElemKey()
  1177. } else {
  1178. e.e.WriteMapElemValue()
  1179. }
  1180. }
  1181. e.e.EncodeBool(v2)
  1182. }
  1183. e.e.WriteMapEnd()
  1184. }
  1185. func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  1186. fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e)
  1187. }
  1188. func (fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) {
  1189. if v == nil {
  1190. e.e.EncodeNil()
  1191. return
  1192. }
  1193. e.e.WriteMapStart(len(v))
  1194. if e.h.Canonical {
  1195. v2 := make([]string, len(v))
  1196. var i uint
  1197. for k := range v {
  1198. v2[i] = k
  1199. i++
  1200. }
  1201. sort.Sort(stringSlice(v2))
  1202. for _, k2 := range v2 {
  1203. if e.esep {
  1204. e.e.WriteMapElemKey()
  1205. }
  1206. if e.h.StringToRaw {
  1207. e.e.EncodeStringBytesRaw(bytesView(k2))
  1208. } else {
  1209. e.e.EncodeStringEnc(cUTF8, k2)
  1210. }
  1211. if e.esep {
  1212. e.e.WriteMapElemValue()
  1213. }
  1214. e.encode(v[k2])
  1215. }
  1216. } else {
  1217. for k2, v2 := range v {
  1218. if e.esep {
  1219. e.e.WriteMapElemKey()
  1220. }
  1221. if e.h.StringToRaw {
  1222. e.e.EncodeStringBytesRaw(bytesView(k2))
  1223. } else {
  1224. e.e.EncodeStringEnc(cUTF8, k2)
  1225. }
  1226. if e.esep {
  1227. e.e.WriteMapElemValue()
  1228. }
  1229. e.encode(v2)
  1230. }
  1231. }
  1232. e.e.WriteMapEnd()
  1233. }
  1234. func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  1235. fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e)
  1236. }
  1237. func (fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) {
  1238. if v == nil {
  1239. e.e.EncodeNil()
  1240. return
  1241. }
  1242. e.e.WriteMapStart(len(v))
  1243. if e.h.Canonical {
  1244. v2 := make([]string, len(v))
  1245. var i uint
  1246. for k := range v {
  1247. v2[i] = k
  1248. i++
  1249. }
  1250. sort.Sort(stringSlice(v2))
  1251. for _, k2 := range v2 {
  1252. if e.esep {
  1253. e.e.WriteMapElemKey()
  1254. }
  1255. if e.h.StringToRaw {
  1256. e.e.EncodeStringBytesRaw(bytesView(k2))
  1257. } else {
  1258. e.e.EncodeStringEnc(cUTF8, k2)
  1259. }
  1260. if e.esep {
  1261. e.e.WriteMapElemValue()
  1262. }
  1263. if e.h.StringToRaw {
  1264. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  1265. } else {
  1266. e.e.EncodeStringEnc(cUTF8, v[k2])
  1267. }
  1268. }
  1269. } else {
  1270. for k2, v2 := range v {
  1271. if e.esep {
  1272. e.e.WriteMapElemKey()
  1273. }
  1274. if e.h.StringToRaw {
  1275. e.e.EncodeStringBytesRaw(bytesView(k2))
  1276. } else {
  1277. e.e.EncodeStringEnc(cUTF8, k2)
  1278. }
  1279. if e.esep {
  1280. e.e.WriteMapElemValue()
  1281. }
  1282. if e.h.StringToRaw {
  1283. e.e.EncodeStringBytesRaw(bytesView(v2))
  1284. } else {
  1285. e.e.EncodeStringEnc(cUTF8, v2)
  1286. }
  1287. }
  1288. }
  1289. e.e.WriteMapEnd()
  1290. }
  1291. func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  1292. fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e)
  1293. }
  1294. func (fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) {
  1295. if v == nil {
  1296. e.e.EncodeNil()
  1297. return
  1298. }
  1299. e.e.WriteMapStart(len(v))
  1300. if e.h.Canonical {
  1301. v2 := make([]string, len(v))
  1302. var i uint
  1303. for k := range v {
  1304. v2[i] = k
  1305. i++
  1306. }
  1307. sort.Sort(stringSlice(v2))
  1308. for _, k2 := range v2 {
  1309. if e.esep {
  1310. e.e.WriteMapElemKey()
  1311. }
  1312. if e.h.StringToRaw {
  1313. e.e.EncodeStringBytesRaw(bytesView(k2))
  1314. } else {
  1315. e.e.EncodeStringEnc(cUTF8, k2)
  1316. }
  1317. if e.esep {
  1318. e.e.WriteMapElemValue()
  1319. }
  1320. e.e.EncodeUint(uint64(v[k2]))
  1321. }
  1322. } else {
  1323. for k2, v2 := range v {
  1324. if e.esep {
  1325. e.e.WriteMapElemKey()
  1326. }
  1327. if e.h.StringToRaw {
  1328. e.e.EncodeStringBytesRaw(bytesView(k2))
  1329. } else {
  1330. e.e.EncodeStringEnc(cUTF8, k2)
  1331. }
  1332. if e.esep {
  1333. e.e.WriteMapElemValue()
  1334. }
  1335. e.e.EncodeUint(uint64(v2))
  1336. }
  1337. }
  1338. e.e.WriteMapEnd()
  1339. }
  1340. func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  1341. fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e)
  1342. }
  1343. func (fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) {
  1344. if v == nil {
  1345. e.e.EncodeNil()
  1346. return
  1347. }
  1348. e.e.WriteMapStart(len(v))
  1349. if e.h.Canonical {
  1350. v2 := make([]string, len(v))
  1351. var i uint
  1352. for k := range v {
  1353. v2[i] = k
  1354. i++
  1355. }
  1356. sort.Sort(stringSlice(v2))
  1357. for _, k2 := range v2 {
  1358. if e.esep {
  1359. e.e.WriteMapElemKey()
  1360. }
  1361. if e.h.StringToRaw {
  1362. e.e.EncodeStringBytesRaw(bytesView(k2))
  1363. } else {
  1364. e.e.EncodeStringEnc(cUTF8, k2)
  1365. }
  1366. if e.esep {
  1367. e.e.WriteMapElemValue()
  1368. }
  1369. e.e.EncodeUint(uint64(v[k2]))
  1370. }
  1371. } else {
  1372. for k2, v2 := range v {
  1373. if e.esep {
  1374. e.e.WriteMapElemKey()
  1375. }
  1376. if e.h.StringToRaw {
  1377. e.e.EncodeStringBytesRaw(bytesView(k2))
  1378. } else {
  1379. e.e.EncodeStringEnc(cUTF8, k2)
  1380. }
  1381. if e.esep {
  1382. e.e.WriteMapElemValue()
  1383. }
  1384. e.e.EncodeUint(uint64(v2))
  1385. }
  1386. }
  1387. e.e.WriteMapEnd()
  1388. }
  1389. func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  1390. fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e)
  1391. }
  1392. func (fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) {
  1393. if v == nil {
  1394. e.e.EncodeNil()
  1395. return
  1396. }
  1397. e.e.WriteMapStart(len(v))
  1398. if e.h.Canonical {
  1399. v2 := make([]string, len(v))
  1400. var i uint
  1401. for k := range v {
  1402. v2[i] = k
  1403. i++
  1404. }
  1405. sort.Sort(stringSlice(v2))
  1406. for _, k2 := range v2 {
  1407. if e.esep {
  1408. e.e.WriteMapElemKey()
  1409. }
  1410. if e.h.StringToRaw {
  1411. e.e.EncodeStringBytesRaw(bytesView(k2))
  1412. } else {
  1413. e.e.EncodeStringEnc(cUTF8, k2)
  1414. }
  1415. if e.esep {
  1416. e.e.WriteMapElemValue()
  1417. }
  1418. e.e.EncodeUint(v[k2])
  1419. }
  1420. } else {
  1421. for k2, v2 := range v {
  1422. if e.esep {
  1423. e.e.WriteMapElemKey()
  1424. }
  1425. if e.h.StringToRaw {
  1426. e.e.EncodeStringBytesRaw(bytesView(k2))
  1427. } else {
  1428. e.e.EncodeStringEnc(cUTF8, k2)
  1429. }
  1430. if e.esep {
  1431. e.e.WriteMapElemValue()
  1432. }
  1433. e.e.EncodeUint(v2)
  1434. }
  1435. }
  1436. e.e.WriteMapEnd()
  1437. }
  1438. func (e *Encoder) fastpathEncMapStringUintptrR(f *codecFnInfo, rv reflect.Value) {
  1439. fastpathTV.EncMapStringUintptrV(rv2i(rv).(map[string]uintptr), e)
  1440. }
  1441. func (fastpathT) EncMapStringUintptrV(v map[string]uintptr, e *Encoder) {
  1442. if v == nil {
  1443. e.e.EncodeNil()
  1444. return
  1445. }
  1446. e.e.WriteMapStart(len(v))
  1447. if e.h.Canonical {
  1448. v2 := make([]string, len(v))
  1449. var i uint
  1450. for k := range v {
  1451. v2[i] = k
  1452. i++
  1453. }
  1454. sort.Sort(stringSlice(v2))
  1455. for _, k2 := range v2 {
  1456. if e.esep {
  1457. e.e.WriteMapElemKey()
  1458. }
  1459. if e.h.StringToRaw {
  1460. e.e.EncodeStringBytesRaw(bytesView(k2))
  1461. } else {
  1462. e.e.EncodeStringEnc(cUTF8, k2)
  1463. }
  1464. if e.esep {
  1465. e.e.WriteMapElemValue()
  1466. }
  1467. e.encode(v[k2])
  1468. }
  1469. } else {
  1470. for k2, v2 := range v {
  1471. if e.esep {
  1472. e.e.WriteMapElemKey()
  1473. }
  1474. if e.h.StringToRaw {
  1475. e.e.EncodeStringBytesRaw(bytesView(k2))
  1476. } else {
  1477. e.e.EncodeStringEnc(cUTF8, k2)
  1478. }
  1479. if e.esep {
  1480. e.e.WriteMapElemValue()
  1481. }
  1482. e.encode(v2)
  1483. }
  1484. }
  1485. e.e.WriteMapEnd()
  1486. }
  1487. func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  1488. fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e)
  1489. }
  1490. func (fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) {
  1491. if v == nil {
  1492. e.e.EncodeNil()
  1493. return
  1494. }
  1495. e.e.WriteMapStart(len(v))
  1496. if e.h.Canonical {
  1497. v2 := make([]string, len(v))
  1498. var i uint
  1499. for k := range v {
  1500. v2[i] = k
  1501. i++
  1502. }
  1503. sort.Sort(stringSlice(v2))
  1504. for _, k2 := range v2 {
  1505. if e.esep {
  1506. e.e.WriteMapElemKey()
  1507. }
  1508. if e.h.StringToRaw {
  1509. e.e.EncodeStringBytesRaw(bytesView(k2))
  1510. } else {
  1511. e.e.EncodeStringEnc(cUTF8, k2)
  1512. }
  1513. if e.esep {
  1514. e.e.WriteMapElemValue()
  1515. }
  1516. e.e.EncodeInt(int64(v[k2]))
  1517. }
  1518. } else {
  1519. for k2, v2 := range v {
  1520. if e.esep {
  1521. e.e.WriteMapElemKey()
  1522. }
  1523. if e.h.StringToRaw {
  1524. e.e.EncodeStringBytesRaw(bytesView(k2))
  1525. } else {
  1526. e.e.EncodeStringEnc(cUTF8, k2)
  1527. }
  1528. if e.esep {
  1529. e.e.WriteMapElemValue()
  1530. }
  1531. e.e.EncodeInt(int64(v2))
  1532. }
  1533. }
  1534. e.e.WriteMapEnd()
  1535. }
  1536. func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  1537. fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e)
  1538. }
  1539. func (fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) {
  1540. if v == nil {
  1541. e.e.EncodeNil()
  1542. return
  1543. }
  1544. e.e.WriteMapStart(len(v))
  1545. if e.h.Canonical {
  1546. v2 := make([]string, len(v))
  1547. var i uint
  1548. for k := range v {
  1549. v2[i] = k
  1550. i++
  1551. }
  1552. sort.Sort(stringSlice(v2))
  1553. for _, k2 := range v2 {
  1554. if e.esep {
  1555. e.e.WriteMapElemKey()
  1556. }
  1557. if e.h.StringToRaw {
  1558. e.e.EncodeStringBytesRaw(bytesView(k2))
  1559. } else {
  1560. e.e.EncodeStringEnc(cUTF8, k2)
  1561. }
  1562. if e.esep {
  1563. e.e.WriteMapElemValue()
  1564. }
  1565. e.e.EncodeInt(v[k2])
  1566. }
  1567. } else {
  1568. for k2, v2 := range v {
  1569. if e.esep {
  1570. e.e.WriteMapElemKey()
  1571. }
  1572. if e.h.StringToRaw {
  1573. e.e.EncodeStringBytesRaw(bytesView(k2))
  1574. } else {
  1575. e.e.EncodeStringEnc(cUTF8, k2)
  1576. }
  1577. if e.esep {
  1578. e.e.WriteMapElemValue()
  1579. }
  1580. e.e.EncodeInt(v2)
  1581. }
  1582. }
  1583. e.e.WriteMapEnd()
  1584. }
  1585. func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  1586. fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e)
  1587. }
  1588. func (fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) {
  1589. if v == nil {
  1590. e.e.EncodeNil()
  1591. return
  1592. }
  1593. e.e.WriteMapStart(len(v))
  1594. if e.h.Canonical {
  1595. v2 := make([]string, len(v))
  1596. var i uint
  1597. for k := range v {
  1598. v2[i] = k
  1599. i++
  1600. }
  1601. sort.Sort(stringSlice(v2))
  1602. for _, k2 := range v2 {
  1603. if e.esep {
  1604. e.e.WriteMapElemKey()
  1605. }
  1606. if e.h.StringToRaw {
  1607. e.e.EncodeStringBytesRaw(bytesView(k2))
  1608. } else {
  1609. e.e.EncodeStringEnc(cUTF8, k2)
  1610. }
  1611. if e.esep {
  1612. e.e.WriteMapElemValue()
  1613. }
  1614. e.e.EncodeFloat32(v[k2])
  1615. }
  1616. } else {
  1617. for k2, v2 := range v {
  1618. if e.esep {
  1619. e.e.WriteMapElemKey()
  1620. }
  1621. if e.h.StringToRaw {
  1622. e.e.EncodeStringBytesRaw(bytesView(k2))
  1623. } else {
  1624. e.e.EncodeStringEnc(cUTF8, k2)
  1625. }
  1626. if e.esep {
  1627. e.e.WriteMapElemValue()
  1628. }
  1629. e.e.EncodeFloat32(v2)
  1630. }
  1631. }
  1632. e.e.WriteMapEnd()
  1633. }
  1634. func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  1635. fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e)
  1636. }
  1637. func (fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) {
  1638. if v == nil {
  1639. e.e.EncodeNil()
  1640. return
  1641. }
  1642. e.e.WriteMapStart(len(v))
  1643. if e.h.Canonical {
  1644. v2 := make([]string, len(v))
  1645. var i uint
  1646. for k := range v {
  1647. v2[i] = k
  1648. i++
  1649. }
  1650. sort.Sort(stringSlice(v2))
  1651. for _, k2 := range v2 {
  1652. if e.esep {
  1653. e.e.WriteMapElemKey()
  1654. }
  1655. if e.h.StringToRaw {
  1656. e.e.EncodeStringBytesRaw(bytesView(k2))
  1657. } else {
  1658. e.e.EncodeStringEnc(cUTF8, k2)
  1659. }
  1660. if e.esep {
  1661. e.e.WriteMapElemValue()
  1662. }
  1663. e.e.EncodeFloat64(v[k2])
  1664. }
  1665. } else {
  1666. for k2, v2 := range v {
  1667. if e.esep {
  1668. e.e.WriteMapElemKey()
  1669. }
  1670. if e.h.StringToRaw {
  1671. e.e.EncodeStringBytesRaw(bytesView(k2))
  1672. } else {
  1673. e.e.EncodeStringEnc(cUTF8, k2)
  1674. }
  1675. if e.esep {
  1676. e.e.WriteMapElemValue()
  1677. }
  1678. e.e.EncodeFloat64(v2)
  1679. }
  1680. }
  1681. e.e.WriteMapEnd()
  1682. }
  1683. func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  1684. fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e)
  1685. }
  1686. func (fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) {
  1687. if v == nil {
  1688. e.e.EncodeNil()
  1689. return
  1690. }
  1691. e.e.WriteMapStart(len(v))
  1692. if e.h.Canonical {
  1693. v2 := make([]string, len(v))
  1694. var i uint
  1695. for k := range v {
  1696. v2[i] = k
  1697. i++
  1698. }
  1699. sort.Sort(stringSlice(v2))
  1700. for _, k2 := range v2 {
  1701. if e.esep {
  1702. e.e.WriteMapElemKey()
  1703. }
  1704. if e.h.StringToRaw {
  1705. e.e.EncodeStringBytesRaw(bytesView(k2))
  1706. } else {
  1707. e.e.EncodeStringEnc(cUTF8, k2)
  1708. }
  1709. if e.esep {
  1710. e.e.WriteMapElemValue()
  1711. }
  1712. e.e.EncodeBool(v[k2])
  1713. }
  1714. } else {
  1715. for k2, v2 := range v {
  1716. if e.esep {
  1717. e.e.WriteMapElemKey()
  1718. }
  1719. if e.h.StringToRaw {
  1720. e.e.EncodeStringBytesRaw(bytesView(k2))
  1721. } else {
  1722. e.e.EncodeStringEnc(cUTF8, k2)
  1723. }
  1724. if e.esep {
  1725. e.e.WriteMapElemValue()
  1726. }
  1727. e.e.EncodeBool(v2)
  1728. }
  1729. }
  1730. e.e.WriteMapEnd()
  1731. }
  1732. func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  1733. fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e)
  1734. }
  1735. func (fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) {
  1736. if v == nil {
  1737. e.e.EncodeNil()
  1738. return
  1739. }
  1740. e.e.WriteMapStart(len(v))
  1741. if e.h.Canonical {
  1742. v2 := make([]uint64, len(v))
  1743. var i uint
  1744. for k := range v {
  1745. v2[i] = uint64(k)
  1746. i++
  1747. }
  1748. sort.Sort(uint64Slice(v2))
  1749. for _, k2 := range v2 {
  1750. if e.esep {
  1751. e.e.WriteMapElemKey()
  1752. }
  1753. e.e.EncodeUint(uint64(uint(k2)))
  1754. if e.esep {
  1755. e.e.WriteMapElemValue()
  1756. }
  1757. e.encode(v[uint(k2)])
  1758. }
  1759. } else {
  1760. for k2, v2 := range v {
  1761. if e.esep {
  1762. e.e.WriteMapElemKey()
  1763. }
  1764. e.e.EncodeUint(uint64(k2))
  1765. if e.esep {
  1766. e.e.WriteMapElemValue()
  1767. }
  1768. e.encode(v2)
  1769. }
  1770. }
  1771. e.e.WriteMapEnd()
  1772. }
  1773. func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  1774. fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e)
  1775. }
  1776. func (fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) {
  1777. if v == nil {
  1778. e.e.EncodeNil()
  1779. return
  1780. }
  1781. e.e.WriteMapStart(len(v))
  1782. if e.h.Canonical {
  1783. v2 := make([]uint64, len(v))
  1784. var i uint
  1785. for k := range v {
  1786. v2[i] = uint64(k)
  1787. i++
  1788. }
  1789. sort.Sort(uint64Slice(v2))
  1790. for _, k2 := range v2 {
  1791. if e.esep {
  1792. e.e.WriteMapElemKey()
  1793. }
  1794. e.e.EncodeUint(uint64(uint(k2)))
  1795. if e.esep {
  1796. e.e.WriteMapElemValue()
  1797. }
  1798. if e.h.StringToRaw {
  1799. e.e.EncodeStringBytesRaw(bytesView(v[uint(k2)]))
  1800. } else {
  1801. e.e.EncodeStringEnc(cUTF8, v[uint(k2)])
  1802. }
  1803. }
  1804. } else {
  1805. for k2, v2 := range v {
  1806. if e.esep {
  1807. e.e.WriteMapElemKey()
  1808. }
  1809. e.e.EncodeUint(uint64(k2))
  1810. if e.esep {
  1811. e.e.WriteMapElemValue()
  1812. }
  1813. if e.h.StringToRaw {
  1814. e.e.EncodeStringBytesRaw(bytesView(v2))
  1815. } else {
  1816. e.e.EncodeStringEnc(cUTF8, v2)
  1817. }
  1818. }
  1819. }
  1820. e.e.WriteMapEnd()
  1821. }
  1822. func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  1823. fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e)
  1824. }
  1825. func (fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) {
  1826. if v == nil {
  1827. e.e.EncodeNil()
  1828. return
  1829. }
  1830. e.e.WriteMapStart(len(v))
  1831. if e.h.Canonical {
  1832. v2 := make([]uint64, len(v))
  1833. var i uint
  1834. for k := range v {
  1835. v2[i] = uint64(k)
  1836. i++
  1837. }
  1838. sort.Sort(uint64Slice(v2))
  1839. for _, k2 := range v2 {
  1840. if e.esep {
  1841. e.e.WriteMapElemKey()
  1842. }
  1843. e.e.EncodeUint(uint64(uint(k2)))
  1844. if e.esep {
  1845. e.e.WriteMapElemValue()
  1846. }
  1847. e.e.EncodeUint(uint64(v[uint(k2)]))
  1848. }
  1849. } else {
  1850. for k2, v2 := range v {
  1851. if e.esep {
  1852. e.e.WriteMapElemKey()
  1853. }
  1854. e.e.EncodeUint(uint64(k2))
  1855. if e.esep {
  1856. e.e.WriteMapElemValue()
  1857. }
  1858. e.e.EncodeUint(uint64(v2))
  1859. }
  1860. }
  1861. e.e.WriteMapEnd()
  1862. }
  1863. func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  1864. fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e)
  1865. }
  1866. func (fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) {
  1867. if v == nil {
  1868. e.e.EncodeNil()
  1869. return
  1870. }
  1871. e.e.WriteMapStart(len(v))
  1872. if e.h.Canonical {
  1873. v2 := make([]uint64, len(v))
  1874. var i uint
  1875. for k := range v {
  1876. v2[i] = uint64(k)
  1877. i++
  1878. }
  1879. sort.Sort(uint64Slice(v2))
  1880. for _, k2 := range v2 {
  1881. if e.esep {
  1882. e.e.WriteMapElemKey()
  1883. }
  1884. e.e.EncodeUint(uint64(uint(k2)))
  1885. if e.esep {
  1886. e.e.WriteMapElemValue()
  1887. }
  1888. e.e.EncodeUint(uint64(v[uint(k2)]))
  1889. }
  1890. } else {
  1891. for k2, v2 := range v {
  1892. if e.esep {
  1893. e.e.WriteMapElemKey()
  1894. }
  1895. e.e.EncodeUint(uint64(k2))
  1896. if e.esep {
  1897. e.e.WriteMapElemValue()
  1898. }
  1899. e.e.EncodeUint(uint64(v2))
  1900. }
  1901. }
  1902. e.e.WriteMapEnd()
  1903. }
  1904. func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  1905. fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e)
  1906. }
  1907. func (fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) {
  1908. if v == nil {
  1909. e.e.EncodeNil()
  1910. return
  1911. }
  1912. e.e.WriteMapStart(len(v))
  1913. if e.h.Canonical {
  1914. v2 := make([]uint64, len(v))
  1915. var i uint
  1916. for k := range v {
  1917. v2[i] = uint64(k)
  1918. i++
  1919. }
  1920. sort.Sort(uint64Slice(v2))
  1921. for _, k2 := range v2 {
  1922. if e.esep {
  1923. e.e.WriteMapElemKey()
  1924. }
  1925. e.e.EncodeUint(uint64(uint(k2)))
  1926. if e.esep {
  1927. e.e.WriteMapElemValue()
  1928. }
  1929. e.e.EncodeUint(v[uint(k2)])
  1930. }
  1931. } else {
  1932. for k2, v2 := range v {
  1933. if e.esep {
  1934. e.e.WriteMapElemKey()
  1935. }
  1936. e.e.EncodeUint(uint64(k2))
  1937. if e.esep {
  1938. e.e.WriteMapElemValue()
  1939. }
  1940. e.e.EncodeUint(v2)
  1941. }
  1942. }
  1943. e.e.WriteMapEnd()
  1944. }
  1945. func (e *Encoder) fastpathEncMapUintUintptrR(f *codecFnInfo, rv reflect.Value) {
  1946. fastpathTV.EncMapUintUintptrV(rv2i(rv).(map[uint]uintptr), e)
  1947. }
  1948. func (fastpathT) EncMapUintUintptrV(v map[uint]uintptr, e *Encoder) {
  1949. if v == nil {
  1950. e.e.EncodeNil()
  1951. return
  1952. }
  1953. e.e.WriteMapStart(len(v))
  1954. if e.h.Canonical {
  1955. v2 := make([]uint64, len(v))
  1956. var i uint
  1957. for k := range v {
  1958. v2[i] = uint64(k)
  1959. i++
  1960. }
  1961. sort.Sort(uint64Slice(v2))
  1962. for _, k2 := range v2 {
  1963. if e.esep {
  1964. e.e.WriteMapElemKey()
  1965. }
  1966. e.e.EncodeUint(uint64(uint(k2)))
  1967. if e.esep {
  1968. e.e.WriteMapElemValue()
  1969. }
  1970. e.encode(v[uint(k2)])
  1971. }
  1972. } else {
  1973. for k2, v2 := range v {
  1974. if e.esep {
  1975. e.e.WriteMapElemKey()
  1976. }
  1977. e.e.EncodeUint(uint64(k2))
  1978. if e.esep {
  1979. e.e.WriteMapElemValue()
  1980. }
  1981. e.encode(v2)
  1982. }
  1983. }
  1984. e.e.WriteMapEnd()
  1985. }
  1986. func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  1987. fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e)
  1988. }
  1989. func (fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) {
  1990. if v == nil {
  1991. e.e.EncodeNil()
  1992. return
  1993. }
  1994. e.e.WriteMapStart(len(v))
  1995. if e.h.Canonical {
  1996. v2 := make([]uint64, len(v))
  1997. var i uint
  1998. for k := range v {
  1999. v2[i] = uint64(k)
  2000. i++
  2001. }
  2002. sort.Sort(uint64Slice(v2))
  2003. for _, k2 := range v2 {
  2004. if e.esep {
  2005. e.e.WriteMapElemKey()
  2006. }
  2007. e.e.EncodeUint(uint64(uint(k2)))
  2008. if e.esep {
  2009. e.e.WriteMapElemValue()
  2010. }
  2011. e.e.EncodeInt(int64(v[uint(k2)]))
  2012. }
  2013. } else {
  2014. for k2, v2 := range v {
  2015. if e.esep {
  2016. e.e.WriteMapElemKey()
  2017. }
  2018. e.e.EncodeUint(uint64(k2))
  2019. if e.esep {
  2020. e.e.WriteMapElemValue()
  2021. }
  2022. e.e.EncodeInt(int64(v2))
  2023. }
  2024. }
  2025. e.e.WriteMapEnd()
  2026. }
  2027. func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  2028. fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e)
  2029. }
  2030. func (fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) {
  2031. if v == nil {
  2032. e.e.EncodeNil()
  2033. return
  2034. }
  2035. e.e.WriteMapStart(len(v))
  2036. if e.h.Canonical {
  2037. v2 := make([]uint64, len(v))
  2038. var i uint
  2039. for k := range v {
  2040. v2[i] = uint64(k)
  2041. i++
  2042. }
  2043. sort.Sort(uint64Slice(v2))
  2044. for _, k2 := range v2 {
  2045. if e.esep {
  2046. e.e.WriteMapElemKey()
  2047. }
  2048. e.e.EncodeUint(uint64(uint(k2)))
  2049. if e.esep {
  2050. e.e.WriteMapElemValue()
  2051. }
  2052. e.e.EncodeInt(v[uint(k2)])
  2053. }
  2054. } else {
  2055. for k2, v2 := range v {
  2056. if e.esep {
  2057. e.e.WriteMapElemKey()
  2058. }
  2059. e.e.EncodeUint(uint64(k2))
  2060. if e.esep {
  2061. e.e.WriteMapElemValue()
  2062. }
  2063. e.e.EncodeInt(v2)
  2064. }
  2065. }
  2066. e.e.WriteMapEnd()
  2067. }
  2068. func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  2069. fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e)
  2070. }
  2071. func (fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) {
  2072. if v == nil {
  2073. e.e.EncodeNil()
  2074. return
  2075. }
  2076. e.e.WriteMapStart(len(v))
  2077. if e.h.Canonical {
  2078. v2 := make([]uint64, len(v))
  2079. var i uint
  2080. for k := range v {
  2081. v2[i] = uint64(k)
  2082. i++
  2083. }
  2084. sort.Sort(uint64Slice(v2))
  2085. for _, k2 := range v2 {
  2086. if e.esep {
  2087. e.e.WriteMapElemKey()
  2088. }
  2089. e.e.EncodeUint(uint64(uint(k2)))
  2090. if e.esep {
  2091. e.e.WriteMapElemValue()
  2092. }
  2093. e.e.EncodeFloat32(v[uint(k2)])
  2094. }
  2095. } else {
  2096. for k2, v2 := range v {
  2097. if e.esep {
  2098. e.e.WriteMapElemKey()
  2099. }
  2100. e.e.EncodeUint(uint64(k2))
  2101. if e.esep {
  2102. e.e.WriteMapElemValue()
  2103. }
  2104. e.e.EncodeFloat32(v2)
  2105. }
  2106. }
  2107. e.e.WriteMapEnd()
  2108. }
  2109. func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  2110. fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e)
  2111. }
  2112. func (fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) {
  2113. if v == nil {
  2114. e.e.EncodeNil()
  2115. return
  2116. }
  2117. e.e.WriteMapStart(len(v))
  2118. if e.h.Canonical {
  2119. v2 := make([]uint64, len(v))
  2120. var i uint
  2121. for k := range v {
  2122. v2[i] = uint64(k)
  2123. i++
  2124. }
  2125. sort.Sort(uint64Slice(v2))
  2126. for _, k2 := range v2 {
  2127. if e.esep {
  2128. e.e.WriteMapElemKey()
  2129. }
  2130. e.e.EncodeUint(uint64(uint(k2)))
  2131. if e.esep {
  2132. e.e.WriteMapElemValue()
  2133. }
  2134. e.e.EncodeFloat64(v[uint(k2)])
  2135. }
  2136. } else {
  2137. for k2, v2 := range v {
  2138. if e.esep {
  2139. e.e.WriteMapElemKey()
  2140. }
  2141. e.e.EncodeUint(uint64(k2))
  2142. if e.esep {
  2143. e.e.WriteMapElemValue()
  2144. }
  2145. e.e.EncodeFloat64(v2)
  2146. }
  2147. }
  2148. e.e.WriteMapEnd()
  2149. }
  2150. func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  2151. fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e)
  2152. }
  2153. func (fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) {
  2154. if v == nil {
  2155. e.e.EncodeNil()
  2156. return
  2157. }
  2158. e.e.WriteMapStart(len(v))
  2159. if e.h.Canonical {
  2160. v2 := make([]uint64, len(v))
  2161. var i uint
  2162. for k := range v {
  2163. v2[i] = uint64(k)
  2164. i++
  2165. }
  2166. sort.Sort(uint64Slice(v2))
  2167. for _, k2 := range v2 {
  2168. if e.esep {
  2169. e.e.WriteMapElemKey()
  2170. }
  2171. e.e.EncodeUint(uint64(uint(k2)))
  2172. if e.esep {
  2173. e.e.WriteMapElemValue()
  2174. }
  2175. e.e.EncodeBool(v[uint(k2)])
  2176. }
  2177. } else {
  2178. for k2, v2 := range v {
  2179. if e.esep {
  2180. e.e.WriteMapElemKey()
  2181. }
  2182. e.e.EncodeUint(uint64(k2))
  2183. if e.esep {
  2184. e.e.WriteMapElemValue()
  2185. }
  2186. e.e.EncodeBool(v2)
  2187. }
  2188. }
  2189. e.e.WriteMapEnd()
  2190. }
  2191. func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  2192. fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e)
  2193. }
  2194. func (fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) {
  2195. if v == nil {
  2196. e.e.EncodeNil()
  2197. return
  2198. }
  2199. e.e.WriteMapStart(len(v))
  2200. if e.h.Canonical {
  2201. v2 := make([]uint64, len(v))
  2202. var i uint
  2203. for k := range v {
  2204. v2[i] = uint64(k)
  2205. i++
  2206. }
  2207. sort.Sort(uint64Slice(v2))
  2208. for _, k2 := range v2 {
  2209. if e.esep {
  2210. e.e.WriteMapElemKey()
  2211. }
  2212. e.e.EncodeUint(uint64(uint8(k2)))
  2213. if e.esep {
  2214. e.e.WriteMapElemValue()
  2215. }
  2216. e.encode(v[uint8(k2)])
  2217. }
  2218. } else {
  2219. for k2, v2 := range v {
  2220. if e.esep {
  2221. e.e.WriteMapElemKey()
  2222. }
  2223. e.e.EncodeUint(uint64(k2))
  2224. if e.esep {
  2225. e.e.WriteMapElemValue()
  2226. }
  2227. e.encode(v2)
  2228. }
  2229. }
  2230. e.e.WriteMapEnd()
  2231. }
  2232. func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  2233. fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e)
  2234. }
  2235. func (fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) {
  2236. if v == nil {
  2237. e.e.EncodeNil()
  2238. return
  2239. }
  2240. e.e.WriteMapStart(len(v))
  2241. if e.h.Canonical {
  2242. v2 := make([]uint64, len(v))
  2243. var i uint
  2244. for k := range v {
  2245. v2[i] = uint64(k)
  2246. i++
  2247. }
  2248. sort.Sort(uint64Slice(v2))
  2249. for _, k2 := range v2 {
  2250. if e.esep {
  2251. e.e.WriteMapElemKey()
  2252. }
  2253. e.e.EncodeUint(uint64(uint8(k2)))
  2254. if e.esep {
  2255. e.e.WriteMapElemValue()
  2256. }
  2257. if e.h.StringToRaw {
  2258. e.e.EncodeStringBytesRaw(bytesView(v[uint8(k2)]))
  2259. } else {
  2260. e.e.EncodeStringEnc(cUTF8, v[uint8(k2)])
  2261. }
  2262. }
  2263. } else {
  2264. for k2, v2 := range v {
  2265. if e.esep {
  2266. e.e.WriteMapElemKey()
  2267. }
  2268. e.e.EncodeUint(uint64(k2))
  2269. if e.esep {
  2270. e.e.WriteMapElemValue()
  2271. }
  2272. if e.h.StringToRaw {
  2273. e.e.EncodeStringBytesRaw(bytesView(v2))
  2274. } else {
  2275. e.e.EncodeStringEnc(cUTF8, v2)
  2276. }
  2277. }
  2278. }
  2279. e.e.WriteMapEnd()
  2280. }
  2281. func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  2282. fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e)
  2283. }
  2284. func (fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) {
  2285. if v == nil {
  2286. e.e.EncodeNil()
  2287. return
  2288. }
  2289. e.e.WriteMapStart(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. if e.esep {
  2300. e.e.WriteMapElemKey()
  2301. }
  2302. e.e.EncodeUint(uint64(uint8(k2)))
  2303. if e.esep {
  2304. e.e.WriteMapElemValue()
  2305. }
  2306. e.e.EncodeUint(uint64(v[uint8(k2)]))
  2307. }
  2308. } else {
  2309. for k2, v2 := range v {
  2310. if e.esep {
  2311. e.e.WriteMapElemKey()
  2312. }
  2313. e.e.EncodeUint(uint64(k2))
  2314. if e.esep {
  2315. e.e.WriteMapElemValue()
  2316. }
  2317. e.e.EncodeUint(uint64(v2))
  2318. }
  2319. }
  2320. e.e.WriteMapEnd()
  2321. }
  2322. func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  2323. fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e)
  2324. }
  2325. func (fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) {
  2326. if v == nil {
  2327. e.e.EncodeNil()
  2328. return
  2329. }
  2330. e.e.WriteMapStart(len(v))
  2331. if e.h.Canonical {
  2332. v2 := make([]uint64, len(v))
  2333. var i uint
  2334. for k := range v {
  2335. v2[i] = uint64(k)
  2336. i++
  2337. }
  2338. sort.Sort(uint64Slice(v2))
  2339. for _, k2 := range v2 {
  2340. if e.esep {
  2341. e.e.WriteMapElemKey()
  2342. }
  2343. e.e.EncodeUint(uint64(uint8(k2)))
  2344. if e.esep {
  2345. e.e.WriteMapElemValue()
  2346. }
  2347. e.e.EncodeUint(uint64(v[uint8(k2)]))
  2348. }
  2349. } else {
  2350. for k2, v2 := range v {
  2351. if e.esep {
  2352. e.e.WriteMapElemKey()
  2353. }
  2354. e.e.EncodeUint(uint64(k2))
  2355. if e.esep {
  2356. e.e.WriteMapElemValue()
  2357. }
  2358. e.e.EncodeUint(uint64(v2))
  2359. }
  2360. }
  2361. e.e.WriteMapEnd()
  2362. }
  2363. func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  2364. fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e)
  2365. }
  2366. func (fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) {
  2367. if v == nil {
  2368. e.e.EncodeNil()
  2369. return
  2370. }
  2371. e.e.WriteMapStart(len(v))
  2372. if e.h.Canonical {
  2373. v2 := make([]uint64, len(v))
  2374. var i uint
  2375. for k := range v {
  2376. v2[i] = uint64(k)
  2377. i++
  2378. }
  2379. sort.Sort(uint64Slice(v2))
  2380. for _, k2 := range v2 {
  2381. if e.esep {
  2382. e.e.WriteMapElemKey()
  2383. }
  2384. e.e.EncodeUint(uint64(uint8(k2)))
  2385. if e.esep {
  2386. e.e.WriteMapElemValue()
  2387. }
  2388. e.e.EncodeUint(v[uint8(k2)])
  2389. }
  2390. } else {
  2391. for k2, v2 := range v {
  2392. if e.esep {
  2393. e.e.WriteMapElemKey()
  2394. }
  2395. e.e.EncodeUint(uint64(k2))
  2396. if e.esep {
  2397. e.e.WriteMapElemValue()
  2398. }
  2399. e.e.EncodeUint(v2)
  2400. }
  2401. }
  2402. e.e.WriteMapEnd()
  2403. }
  2404. func (e *Encoder) fastpathEncMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) {
  2405. fastpathTV.EncMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), e)
  2406. }
  2407. func (fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, e *Encoder) {
  2408. if v == nil {
  2409. e.e.EncodeNil()
  2410. return
  2411. }
  2412. e.e.WriteMapStart(len(v))
  2413. if e.h.Canonical {
  2414. v2 := make([]uint64, len(v))
  2415. var i uint
  2416. for k := range v {
  2417. v2[i] = uint64(k)
  2418. i++
  2419. }
  2420. sort.Sort(uint64Slice(v2))
  2421. for _, k2 := range v2 {
  2422. if e.esep {
  2423. e.e.WriteMapElemKey()
  2424. }
  2425. e.e.EncodeUint(uint64(uint8(k2)))
  2426. if e.esep {
  2427. e.e.WriteMapElemValue()
  2428. }
  2429. e.encode(v[uint8(k2)])
  2430. }
  2431. } else {
  2432. for k2, v2 := range v {
  2433. if e.esep {
  2434. e.e.WriteMapElemKey()
  2435. }
  2436. e.e.EncodeUint(uint64(k2))
  2437. if e.esep {
  2438. e.e.WriteMapElemValue()
  2439. }
  2440. e.encode(v2)
  2441. }
  2442. }
  2443. e.e.WriteMapEnd()
  2444. }
  2445. func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  2446. fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e)
  2447. }
  2448. func (fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) {
  2449. if v == nil {
  2450. e.e.EncodeNil()
  2451. return
  2452. }
  2453. e.e.WriteMapStart(len(v))
  2454. if e.h.Canonical {
  2455. v2 := make([]uint64, len(v))
  2456. var i uint
  2457. for k := range v {
  2458. v2[i] = uint64(k)
  2459. i++
  2460. }
  2461. sort.Sort(uint64Slice(v2))
  2462. for _, k2 := range v2 {
  2463. if e.esep {
  2464. e.e.WriteMapElemKey()
  2465. }
  2466. e.e.EncodeUint(uint64(uint8(k2)))
  2467. if e.esep {
  2468. e.e.WriteMapElemValue()
  2469. }
  2470. e.e.EncodeInt(int64(v[uint8(k2)]))
  2471. }
  2472. } else {
  2473. for k2, v2 := range v {
  2474. if e.esep {
  2475. e.e.WriteMapElemKey()
  2476. }
  2477. e.e.EncodeUint(uint64(k2))
  2478. if e.esep {
  2479. e.e.WriteMapElemValue()
  2480. }
  2481. e.e.EncodeInt(int64(v2))
  2482. }
  2483. }
  2484. e.e.WriteMapEnd()
  2485. }
  2486. func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  2487. fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e)
  2488. }
  2489. func (fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) {
  2490. if v == nil {
  2491. e.e.EncodeNil()
  2492. return
  2493. }
  2494. e.e.WriteMapStart(len(v))
  2495. if e.h.Canonical {
  2496. v2 := make([]uint64, len(v))
  2497. var i uint
  2498. for k := range v {
  2499. v2[i] = uint64(k)
  2500. i++
  2501. }
  2502. sort.Sort(uint64Slice(v2))
  2503. for _, k2 := range v2 {
  2504. if e.esep {
  2505. e.e.WriteMapElemKey()
  2506. }
  2507. e.e.EncodeUint(uint64(uint8(k2)))
  2508. if e.esep {
  2509. e.e.WriteMapElemValue()
  2510. }
  2511. e.e.EncodeInt(v[uint8(k2)])
  2512. }
  2513. } else {
  2514. for k2, v2 := range v {
  2515. if e.esep {
  2516. e.e.WriteMapElemKey()
  2517. }
  2518. e.e.EncodeUint(uint64(k2))
  2519. if e.esep {
  2520. e.e.WriteMapElemValue()
  2521. }
  2522. e.e.EncodeInt(v2)
  2523. }
  2524. }
  2525. e.e.WriteMapEnd()
  2526. }
  2527. func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  2528. fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e)
  2529. }
  2530. func (fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) {
  2531. if v == nil {
  2532. e.e.EncodeNil()
  2533. return
  2534. }
  2535. e.e.WriteMapStart(len(v))
  2536. if e.h.Canonical {
  2537. v2 := make([]uint64, len(v))
  2538. var i uint
  2539. for k := range v {
  2540. v2[i] = uint64(k)
  2541. i++
  2542. }
  2543. sort.Sort(uint64Slice(v2))
  2544. for _, k2 := range v2 {
  2545. if e.esep {
  2546. e.e.WriteMapElemKey()
  2547. }
  2548. e.e.EncodeUint(uint64(uint8(k2)))
  2549. if e.esep {
  2550. e.e.WriteMapElemValue()
  2551. }
  2552. e.e.EncodeFloat32(v[uint8(k2)])
  2553. }
  2554. } else {
  2555. for k2, v2 := range v {
  2556. if e.esep {
  2557. e.e.WriteMapElemKey()
  2558. }
  2559. e.e.EncodeUint(uint64(k2))
  2560. if e.esep {
  2561. e.e.WriteMapElemValue()
  2562. }
  2563. e.e.EncodeFloat32(v2)
  2564. }
  2565. }
  2566. e.e.WriteMapEnd()
  2567. }
  2568. func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  2569. fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e)
  2570. }
  2571. func (fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) {
  2572. if v == nil {
  2573. e.e.EncodeNil()
  2574. return
  2575. }
  2576. e.e.WriteMapStart(len(v))
  2577. if e.h.Canonical {
  2578. v2 := make([]uint64, len(v))
  2579. var i uint
  2580. for k := range v {
  2581. v2[i] = uint64(k)
  2582. i++
  2583. }
  2584. sort.Sort(uint64Slice(v2))
  2585. for _, k2 := range v2 {
  2586. if e.esep {
  2587. e.e.WriteMapElemKey()
  2588. }
  2589. e.e.EncodeUint(uint64(uint8(k2)))
  2590. if e.esep {
  2591. e.e.WriteMapElemValue()
  2592. }
  2593. e.e.EncodeFloat64(v[uint8(k2)])
  2594. }
  2595. } else {
  2596. for k2, v2 := range v {
  2597. if e.esep {
  2598. e.e.WriteMapElemKey()
  2599. }
  2600. e.e.EncodeUint(uint64(k2))
  2601. if e.esep {
  2602. e.e.WriteMapElemValue()
  2603. }
  2604. e.e.EncodeFloat64(v2)
  2605. }
  2606. }
  2607. e.e.WriteMapEnd()
  2608. }
  2609. func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  2610. fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e)
  2611. }
  2612. func (fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) {
  2613. if v == nil {
  2614. e.e.EncodeNil()
  2615. return
  2616. }
  2617. e.e.WriteMapStart(len(v))
  2618. if e.h.Canonical {
  2619. v2 := make([]uint64, len(v))
  2620. var i uint
  2621. for k := range v {
  2622. v2[i] = uint64(k)
  2623. i++
  2624. }
  2625. sort.Sort(uint64Slice(v2))
  2626. for _, k2 := range v2 {
  2627. if e.esep {
  2628. e.e.WriteMapElemKey()
  2629. }
  2630. e.e.EncodeUint(uint64(uint8(k2)))
  2631. if e.esep {
  2632. e.e.WriteMapElemValue()
  2633. }
  2634. e.e.EncodeBool(v[uint8(k2)])
  2635. }
  2636. } else {
  2637. for k2, v2 := range v {
  2638. if e.esep {
  2639. e.e.WriteMapElemKey()
  2640. }
  2641. e.e.EncodeUint(uint64(k2))
  2642. if e.esep {
  2643. e.e.WriteMapElemValue()
  2644. }
  2645. e.e.EncodeBool(v2)
  2646. }
  2647. }
  2648. e.e.WriteMapEnd()
  2649. }
  2650. func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  2651. fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e)
  2652. }
  2653. func (fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) {
  2654. if v == nil {
  2655. e.e.EncodeNil()
  2656. return
  2657. }
  2658. e.e.WriteMapStart(len(v))
  2659. if e.h.Canonical {
  2660. v2 := make([]uint64, len(v))
  2661. var i uint
  2662. for k := range v {
  2663. v2[i] = k
  2664. i++
  2665. }
  2666. sort.Sort(uint64Slice(v2))
  2667. for _, k2 := range v2 {
  2668. if e.esep {
  2669. e.e.WriteMapElemKey()
  2670. }
  2671. e.e.EncodeUint(k2)
  2672. if e.esep {
  2673. e.e.WriteMapElemValue()
  2674. }
  2675. e.encode(v[k2])
  2676. }
  2677. } else {
  2678. for k2, v2 := range v {
  2679. if e.esep {
  2680. e.e.WriteMapElemKey()
  2681. }
  2682. e.e.EncodeUint(k2)
  2683. if e.esep {
  2684. e.e.WriteMapElemValue()
  2685. }
  2686. e.encode(v2)
  2687. }
  2688. }
  2689. e.e.WriteMapEnd()
  2690. }
  2691. func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  2692. fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e)
  2693. }
  2694. func (fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) {
  2695. if v == nil {
  2696. e.e.EncodeNil()
  2697. return
  2698. }
  2699. e.e.WriteMapStart(len(v))
  2700. if e.h.Canonical {
  2701. v2 := make([]uint64, len(v))
  2702. var i uint
  2703. for k := range v {
  2704. v2[i] = k
  2705. i++
  2706. }
  2707. sort.Sort(uint64Slice(v2))
  2708. for _, k2 := range v2 {
  2709. if e.esep {
  2710. e.e.WriteMapElemKey()
  2711. }
  2712. e.e.EncodeUint(k2)
  2713. if e.esep {
  2714. e.e.WriteMapElemValue()
  2715. }
  2716. if e.h.StringToRaw {
  2717. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  2718. } else {
  2719. e.e.EncodeStringEnc(cUTF8, v[k2])
  2720. }
  2721. }
  2722. } else {
  2723. for k2, v2 := range v {
  2724. if e.esep {
  2725. e.e.WriteMapElemKey()
  2726. }
  2727. e.e.EncodeUint(k2)
  2728. if e.esep {
  2729. e.e.WriteMapElemValue()
  2730. }
  2731. if e.h.StringToRaw {
  2732. e.e.EncodeStringBytesRaw(bytesView(v2))
  2733. } else {
  2734. e.e.EncodeStringEnc(cUTF8, v2)
  2735. }
  2736. }
  2737. }
  2738. e.e.WriteMapEnd()
  2739. }
  2740. func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  2741. fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e)
  2742. }
  2743. func (fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) {
  2744. if v == nil {
  2745. e.e.EncodeNil()
  2746. return
  2747. }
  2748. e.e.WriteMapStart(len(v))
  2749. if e.h.Canonical {
  2750. v2 := make([]uint64, len(v))
  2751. var i uint
  2752. for k := range v {
  2753. v2[i] = k
  2754. i++
  2755. }
  2756. sort.Sort(uint64Slice(v2))
  2757. for _, k2 := range v2 {
  2758. if e.esep {
  2759. e.e.WriteMapElemKey()
  2760. }
  2761. e.e.EncodeUint(k2)
  2762. if e.esep {
  2763. e.e.WriteMapElemValue()
  2764. }
  2765. e.e.EncodeUint(uint64(v[k2]))
  2766. }
  2767. } else {
  2768. for k2, v2 := range v {
  2769. if e.esep {
  2770. e.e.WriteMapElemKey()
  2771. }
  2772. e.e.EncodeUint(k2)
  2773. if e.esep {
  2774. e.e.WriteMapElemValue()
  2775. }
  2776. e.e.EncodeUint(uint64(v2))
  2777. }
  2778. }
  2779. e.e.WriteMapEnd()
  2780. }
  2781. func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  2782. fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e)
  2783. }
  2784. func (fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) {
  2785. if v == nil {
  2786. e.e.EncodeNil()
  2787. return
  2788. }
  2789. e.e.WriteMapStart(len(v))
  2790. if e.h.Canonical {
  2791. v2 := make([]uint64, len(v))
  2792. var i uint
  2793. for k := range v {
  2794. v2[i] = k
  2795. i++
  2796. }
  2797. sort.Sort(uint64Slice(v2))
  2798. for _, k2 := range v2 {
  2799. if e.esep {
  2800. e.e.WriteMapElemKey()
  2801. }
  2802. e.e.EncodeUint(k2)
  2803. if e.esep {
  2804. e.e.WriteMapElemValue()
  2805. }
  2806. e.e.EncodeUint(uint64(v[k2]))
  2807. }
  2808. } else {
  2809. for k2, v2 := range v {
  2810. if e.esep {
  2811. e.e.WriteMapElemKey()
  2812. }
  2813. e.e.EncodeUint(k2)
  2814. if e.esep {
  2815. e.e.WriteMapElemValue()
  2816. }
  2817. e.e.EncodeUint(uint64(v2))
  2818. }
  2819. }
  2820. e.e.WriteMapEnd()
  2821. }
  2822. func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  2823. fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e)
  2824. }
  2825. func (fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) {
  2826. if v == nil {
  2827. e.e.EncodeNil()
  2828. return
  2829. }
  2830. e.e.WriteMapStart(len(v))
  2831. if e.h.Canonical {
  2832. v2 := make([]uint64, len(v))
  2833. var i uint
  2834. for k := range v {
  2835. v2[i] = k
  2836. i++
  2837. }
  2838. sort.Sort(uint64Slice(v2))
  2839. for _, k2 := range v2 {
  2840. if e.esep {
  2841. e.e.WriteMapElemKey()
  2842. }
  2843. e.e.EncodeUint(k2)
  2844. if e.esep {
  2845. e.e.WriteMapElemValue()
  2846. }
  2847. e.e.EncodeUint(v[k2])
  2848. }
  2849. } else {
  2850. for k2, v2 := range v {
  2851. if e.esep {
  2852. e.e.WriteMapElemKey()
  2853. }
  2854. e.e.EncodeUint(k2)
  2855. if e.esep {
  2856. e.e.WriteMapElemValue()
  2857. }
  2858. e.e.EncodeUint(v2)
  2859. }
  2860. }
  2861. e.e.WriteMapEnd()
  2862. }
  2863. func (e *Encoder) fastpathEncMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) {
  2864. fastpathTV.EncMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), e)
  2865. }
  2866. func (fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, e *Encoder) {
  2867. if v == nil {
  2868. e.e.EncodeNil()
  2869. return
  2870. }
  2871. e.e.WriteMapStart(len(v))
  2872. if e.h.Canonical {
  2873. v2 := make([]uint64, len(v))
  2874. var i uint
  2875. for k := range v {
  2876. v2[i] = k
  2877. i++
  2878. }
  2879. sort.Sort(uint64Slice(v2))
  2880. for _, k2 := range v2 {
  2881. if e.esep {
  2882. e.e.WriteMapElemKey()
  2883. }
  2884. e.e.EncodeUint(k2)
  2885. if e.esep {
  2886. e.e.WriteMapElemValue()
  2887. }
  2888. e.encode(v[k2])
  2889. }
  2890. } else {
  2891. for k2, v2 := range v {
  2892. if e.esep {
  2893. e.e.WriteMapElemKey()
  2894. }
  2895. e.e.EncodeUint(k2)
  2896. if e.esep {
  2897. e.e.WriteMapElemValue()
  2898. }
  2899. e.encode(v2)
  2900. }
  2901. }
  2902. e.e.WriteMapEnd()
  2903. }
  2904. func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  2905. fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e)
  2906. }
  2907. func (fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) {
  2908. if v == nil {
  2909. e.e.EncodeNil()
  2910. return
  2911. }
  2912. e.e.WriteMapStart(len(v))
  2913. if e.h.Canonical {
  2914. v2 := make([]uint64, len(v))
  2915. var i uint
  2916. for k := range v {
  2917. v2[i] = k
  2918. i++
  2919. }
  2920. sort.Sort(uint64Slice(v2))
  2921. for _, k2 := range v2 {
  2922. if e.esep {
  2923. e.e.WriteMapElemKey()
  2924. }
  2925. e.e.EncodeUint(k2)
  2926. if e.esep {
  2927. e.e.WriteMapElemValue()
  2928. }
  2929. e.e.EncodeInt(int64(v[k2]))
  2930. }
  2931. } else {
  2932. for k2, v2 := range v {
  2933. if e.esep {
  2934. e.e.WriteMapElemKey()
  2935. }
  2936. e.e.EncodeUint(k2)
  2937. if e.esep {
  2938. e.e.WriteMapElemValue()
  2939. }
  2940. e.e.EncodeInt(int64(v2))
  2941. }
  2942. }
  2943. e.e.WriteMapEnd()
  2944. }
  2945. func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  2946. fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e)
  2947. }
  2948. func (fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) {
  2949. if v == nil {
  2950. e.e.EncodeNil()
  2951. return
  2952. }
  2953. e.e.WriteMapStart(len(v))
  2954. if e.h.Canonical {
  2955. v2 := make([]uint64, len(v))
  2956. var i uint
  2957. for k := range v {
  2958. v2[i] = k
  2959. i++
  2960. }
  2961. sort.Sort(uint64Slice(v2))
  2962. for _, k2 := range v2 {
  2963. if e.esep {
  2964. e.e.WriteMapElemKey()
  2965. }
  2966. e.e.EncodeUint(k2)
  2967. if e.esep {
  2968. e.e.WriteMapElemValue()
  2969. }
  2970. e.e.EncodeInt(v[k2])
  2971. }
  2972. } else {
  2973. for k2, v2 := range v {
  2974. if e.esep {
  2975. e.e.WriteMapElemKey()
  2976. }
  2977. e.e.EncodeUint(k2)
  2978. if e.esep {
  2979. e.e.WriteMapElemValue()
  2980. }
  2981. e.e.EncodeInt(v2)
  2982. }
  2983. }
  2984. e.e.WriteMapEnd()
  2985. }
  2986. func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  2987. fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e)
  2988. }
  2989. func (fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) {
  2990. if v == nil {
  2991. e.e.EncodeNil()
  2992. return
  2993. }
  2994. e.e.WriteMapStart(len(v))
  2995. if e.h.Canonical {
  2996. v2 := make([]uint64, len(v))
  2997. var i uint
  2998. for k := range v {
  2999. v2[i] = k
  3000. i++
  3001. }
  3002. sort.Sort(uint64Slice(v2))
  3003. for _, k2 := range v2 {
  3004. if e.esep {
  3005. e.e.WriteMapElemKey()
  3006. }
  3007. e.e.EncodeUint(k2)
  3008. if e.esep {
  3009. e.e.WriteMapElemValue()
  3010. }
  3011. e.e.EncodeFloat32(v[k2])
  3012. }
  3013. } else {
  3014. for k2, v2 := range v {
  3015. if e.esep {
  3016. e.e.WriteMapElemKey()
  3017. }
  3018. e.e.EncodeUint(k2)
  3019. if e.esep {
  3020. e.e.WriteMapElemValue()
  3021. }
  3022. e.e.EncodeFloat32(v2)
  3023. }
  3024. }
  3025. e.e.WriteMapEnd()
  3026. }
  3027. func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  3028. fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e)
  3029. }
  3030. func (fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) {
  3031. if v == nil {
  3032. e.e.EncodeNil()
  3033. return
  3034. }
  3035. e.e.WriteMapStart(len(v))
  3036. if e.h.Canonical {
  3037. v2 := make([]uint64, len(v))
  3038. var i uint
  3039. for k := range v {
  3040. v2[i] = k
  3041. i++
  3042. }
  3043. sort.Sort(uint64Slice(v2))
  3044. for _, k2 := range v2 {
  3045. if e.esep {
  3046. e.e.WriteMapElemKey()
  3047. }
  3048. e.e.EncodeUint(k2)
  3049. if e.esep {
  3050. e.e.WriteMapElemValue()
  3051. }
  3052. e.e.EncodeFloat64(v[k2])
  3053. }
  3054. } else {
  3055. for k2, v2 := range v {
  3056. if e.esep {
  3057. e.e.WriteMapElemKey()
  3058. }
  3059. e.e.EncodeUint(k2)
  3060. if e.esep {
  3061. e.e.WriteMapElemValue()
  3062. }
  3063. e.e.EncodeFloat64(v2)
  3064. }
  3065. }
  3066. e.e.WriteMapEnd()
  3067. }
  3068. func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  3069. fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e)
  3070. }
  3071. func (fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) {
  3072. if v == nil {
  3073. e.e.EncodeNil()
  3074. return
  3075. }
  3076. e.e.WriteMapStart(len(v))
  3077. if e.h.Canonical {
  3078. v2 := make([]uint64, len(v))
  3079. var i uint
  3080. for k := range v {
  3081. v2[i] = k
  3082. i++
  3083. }
  3084. sort.Sort(uint64Slice(v2))
  3085. for _, k2 := range v2 {
  3086. if e.esep {
  3087. e.e.WriteMapElemKey()
  3088. }
  3089. e.e.EncodeUint(k2)
  3090. if e.esep {
  3091. e.e.WriteMapElemValue()
  3092. }
  3093. e.e.EncodeBool(v[k2])
  3094. }
  3095. } else {
  3096. for k2, v2 := range v {
  3097. if e.esep {
  3098. e.e.WriteMapElemKey()
  3099. }
  3100. e.e.EncodeUint(k2)
  3101. if e.esep {
  3102. e.e.WriteMapElemValue()
  3103. }
  3104. e.e.EncodeBool(v2)
  3105. }
  3106. }
  3107. e.e.WriteMapEnd()
  3108. }
  3109. func (e *Encoder) fastpathEncMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) {
  3110. fastpathTV.EncMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), e)
  3111. }
  3112. func (fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, e *Encoder) {
  3113. if v == nil {
  3114. e.e.EncodeNil()
  3115. return
  3116. }
  3117. e.e.WriteMapStart(len(v))
  3118. if e.h.Canonical {
  3119. v2 := make([]uint64, len(v))
  3120. var i uint
  3121. for k := range v {
  3122. v2[i] = uint64(k)
  3123. i++
  3124. }
  3125. sort.Sort(uint64Slice(v2))
  3126. for _, k2 := range v2 {
  3127. if e.esep {
  3128. e.e.WriteMapElemKey()
  3129. }
  3130. e.encode(uintptr(k2))
  3131. if e.esep {
  3132. e.e.WriteMapElemValue()
  3133. }
  3134. e.encode(v[uintptr(k2)])
  3135. }
  3136. } else {
  3137. for k2, v2 := range v {
  3138. if e.esep {
  3139. e.e.WriteMapElemKey()
  3140. }
  3141. e.encode(k2)
  3142. if e.esep {
  3143. e.e.WriteMapElemValue()
  3144. }
  3145. e.encode(v2)
  3146. }
  3147. }
  3148. e.e.WriteMapEnd()
  3149. }
  3150. func (e *Encoder) fastpathEncMapUintptrStringR(f *codecFnInfo, rv reflect.Value) {
  3151. fastpathTV.EncMapUintptrStringV(rv2i(rv).(map[uintptr]string), e)
  3152. }
  3153. func (fastpathT) EncMapUintptrStringV(v map[uintptr]string, e *Encoder) {
  3154. if v == nil {
  3155. e.e.EncodeNil()
  3156. return
  3157. }
  3158. e.e.WriteMapStart(len(v))
  3159. if e.h.Canonical {
  3160. v2 := make([]uint64, len(v))
  3161. var i uint
  3162. for k := range v {
  3163. v2[i] = uint64(k)
  3164. i++
  3165. }
  3166. sort.Sort(uint64Slice(v2))
  3167. for _, k2 := range v2 {
  3168. if e.esep {
  3169. e.e.WriteMapElemKey()
  3170. }
  3171. e.encode(uintptr(k2))
  3172. if e.esep {
  3173. e.e.WriteMapElemValue()
  3174. }
  3175. if e.h.StringToRaw {
  3176. e.e.EncodeStringBytesRaw(bytesView(v[uintptr(k2)]))
  3177. } else {
  3178. e.e.EncodeStringEnc(cUTF8, v[uintptr(k2)])
  3179. }
  3180. }
  3181. } else {
  3182. for k2, v2 := range v {
  3183. if e.esep {
  3184. e.e.WriteMapElemKey()
  3185. }
  3186. e.encode(k2)
  3187. if e.esep {
  3188. e.e.WriteMapElemValue()
  3189. }
  3190. if e.h.StringToRaw {
  3191. e.e.EncodeStringBytesRaw(bytesView(v2))
  3192. } else {
  3193. e.e.EncodeStringEnc(cUTF8, v2)
  3194. }
  3195. }
  3196. }
  3197. e.e.WriteMapEnd()
  3198. }
  3199. func (e *Encoder) fastpathEncMapUintptrUintR(f *codecFnInfo, rv reflect.Value) {
  3200. fastpathTV.EncMapUintptrUintV(rv2i(rv).(map[uintptr]uint), e)
  3201. }
  3202. func (fastpathT) EncMapUintptrUintV(v map[uintptr]uint, e *Encoder) {
  3203. if v == nil {
  3204. e.e.EncodeNil()
  3205. return
  3206. }
  3207. e.e.WriteMapStart(len(v))
  3208. if e.h.Canonical {
  3209. v2 := make([]uint64, len(v))
  3210. var i uint
  3211. for k := range v {
  3212. v2[i] = uint64(k)
  3213. i++
  3214. }
  3215. sort.Sort(uint64Slice(v2))
  3216. for _, k2 := range v2 {
  3217. if e.esep {
  3218. e.e.WriteMapElemKey()
  3219. }
  3220. e.encode(uintptr(k2))
  3221. if e.esep {
  3222. e.e.WriteMapElemValue()
  3223. }
  3224. e.e.EncodeUint(uint64(v[uintptr(k2)]))
  3225. }
  3226. } else {
  3227. for k2, v2 := range v {
  3228. if e.esep {
  3229. e.e.WriteMapElemKey()
  3230. }
  3231. e.encode(k2)
  3232. if e.esep {
  3233. e.e.WriteMapElemValue()
  3234. }
  3235. e.e.EncodeUint(uint64(v2))
  3236. }
  3237. }
  3238. e.e.WriteMapEnd()
  3239. }
  3240. func (e *Encoder) fastpathEncMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) {
  3241. fastpathTV.EncMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), e)
  3242. }
  3243. func (fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, e *Encoder) {
  3244. if v == nil {
  3245. e.e.EncodeNil()
  3246. return
  3247. }
  3248. e.e.WriteMapStart(len(v))
  3249. if e.h.Canonical {
  3250. v2 := make([]uint64, len(v))
  3251. var i uint
  3252. for k := range v {
  3253. v2[i] = uint64(k)
  3254. i++
  3255. }
  3256. sort.Sort(uint64Slice(v2))
  3257. for _, k2 := range v2 {
  3258. if e.esep {
  3259. e.e.WriteMapElemKey()
  3260. }
  3261. e.encode(uintptr(k2))
  3262. if e.esep {
  3263. e.e.WriteMapElemValue()
  3264. }
  3265. e.e.EncodeUint(uint64(v[uintptr(k2)]))
  3266. }
  3267. } else {
  3268. for k2, v2 := range v {
  3269. if e.esep {
  3270. e.e.WriteMapElemKey()
  3271. }
  3272. e.encode(k2)
  3273. if e.esep {
  3274. e.e.WriteMapElemValue()
  3275. }
  3276. e.e.EncodeUint(uint64(v2))
  3277. }
  3278. }
  3279. e.e.WriteMapEnd()
  3280. }
  3281. func (e *Encoder) fastpathEncMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) {
  3282. fastpathTV.EncMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), e)
  3283. }
  3284. func (fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, e *Encoder) {
  3285. if v == nil {
  3286. e.e.EncodeNil()
  3287. return
  3288. }
  3289. e.e.WriteMapStart(len(v))
  3290. if e.h.Canonical {
  3291. v2 := make([]uint64, len(v))
  3292. var i uint
  3293. for k := range v {
  3294. v2[i] = uint64(k)
  3295. i++
  3296. }
  3297. sort.Sort(uint64Slice(v2))
  3298. for _, k2 := range v2 {
  3299. if e.esep {
  3300. e.e.WriteMapElemKey()
  3301. }
  3302. e.encode(uintptr(k2))
  3303. if e.esep {
  3304. e.e.WriteMapElemValue()
  3305. }
  3306. e.e.EncodeUint(v[uintptr(k2)])
  3307. }
  3308. } else {
  3309. for k2, v2 := range v {
  3310. if e.esep {
  3311. e.e.WriteMapElemKey()
  3312. }
  3313. e.encode(k2)
  3314. if e.esep {
  3315. e.e.WriteMapElemValue()
  3316. }
  3317. e.e.EncodeUint(v2)
  3318. }
  3319. }
  3320. e.e.WriteMapEnd()
  3321. }
  3322. func (e *Encoder) fastpathEncMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) {
  3323. fastpathTV.EncMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), e)
  3324. }
  3325. func (fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, e *Encoder) {
  3326. if v == nil {
  3327. e.e.EncodeNil()
  3328. return
  3329. }
  3330. e.e.WriteMapStart(len(v))
  3331. if e.h.Canonical {
  3332. v2 := make([]uint64, len(v))
  3333. var i uint
  3334. for k := range v {
  3335. v2[i] = uint64(k)
  3336. i++
  3337. }
  3338. sort.Sort(uint64Slice(v2))
  3339. for _, k2 := range v2 {
  3340. if e.esep {
  3341. e.e.WriteMapElemKey()
  3342. }
  3343. e.encode(uintptr(k2))
  3344. if e.esep {
  3345. e.e.WriteMapElemValue()
  3346. }
  3347. e.encode(v[uintptr(k2)])
  3348. }
  3349. } else {
  3350. for k2, v2 := range v {
  3351. if e.esep {
  3352. e.e.WriteMapElemKey()
  3353. }
  3354. e.encode(k2)
  3355. if e.esep {
  3356. e.e.WriteMapElemValue()
  3357. }
  3358. e.encode(v2)
  3359. }
  3360. }
  3361. e.e.WriteMapEnd()
  3362. }
  3363. func (e *Encoder) fastpathEncMapUintptrIntR(f *codecFnInfo, rv reflect.Value) {
  3364. fastpathTV.EncMapUintptrIntV(rv2i(rv).(map[uintptr]int), e)
  3365. }
  3366. func (fastpathT) EncMapUintptrIntV(v map[uintptr]int, e *Encoder) {
  3367. if v == nil {
  3368. e.e.EncodeNil()
  3369. return
  3370. }
  3371. e.e.WriteMapStart(len(v))
  3372. if e.h.Canonical {
  3373. v2 := make([]uint64, len(v))
  3374. var i uint
  3375. for k := range v {
  3376. v2[i] = uint64(k)
  3377. i++
  3378. }
  3379. sort.Sort(uint64Slice(v2))
  3380. for _, k2 := range v2 {
  3381. if e.esep {
  3382. e.e.WriteMapElemKey()
  3383. }
  3384. e.encode(uintptr(k2))
  3385. if e.esep {
  3386. e.e.WriteMapElemValue()
  3387. }
  3388. e.e.EncodeInt(int64(v[uintptr(k2)]))
  3389. }
  3390. } else {
  3391. for k2, v2 := range v {
  3392. if e.esep {
  3393. e.e.WriteMapElemKey()
  3394. }
  3395. e.encode(k2)
  3396. if e.esep {
  3397. e.e.WriteMapElemValue()
  3398. }
  3399. e.e.EncodeInt(int64(v2))
  3400. }
  3401. }
  3402. e.e.WriteMapEnd()
  3403. }
  3404. func (e *Encoder) fastpathEncMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) {
  3405. fastpathTV.EncMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), e)
  3406. }
  3407. func (fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, e *Encoder) {
  3408. if v == nil {
  3409. e.e.EncodeNil()
  3410. return
  3411. }
  3412. e.e.WriteMapStart(len(v))
  3413. if e.h.Canonical {
  3414. v2 := make([]uint64, len(v))
  3415. var i uint
  3416. for k := range v {
  3417. v2[i] = uint64(k)
  3418. i++
  3419. }
  3420. sort.Sort(uint64Slice(v2))
  3421. for _, k2 := range v2 {
  3422. if e.esep {
  3423. e.e.WriteMapElemKey()
  3424. }
  3425. e.encode(uintptr(k2))
  3426. if e.esep {
  3427. e.e.WriteMapElemValue()
  3428. }
  3429. e.e.EncodeInt(v[uintptr(k2)])
  3430. }
  3431. } else {
  3432. for k2, v2 := range v {
  3433. if e.esep {
  3434. e.e.WriteMapElemKey()
  3435. }
  3436. e.encode(k2)
  3437. if e.esep {
  3438. e.e.WriteMapElemValue()
  3439. }
  3440. e.e.EncodeInt(v2)
  3441. }
  3442. }
  3443. e.e.WriteMapEnd()
  3444. }
  3445. func (e *Encoder) fastpathEncMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) {
  3446. fastpathTV.EncMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), e)
  3447. }
  3448. func (fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, e *Encoder) {
  3449. if v == nil {
  3450. e.e.EncodeNil()
  3451. return
  3452. }
  3453. e.e.WriteMapStart(len(v))
  3454. if e.h.Canonical {
  3455. v2 := make([]uint64, len(v))
  3456. var i uint
  3457. for k := range v {
  3458. v2[i] = uint64(k)
  3459. i++
  3460. }
  3461. sort.Sort(uint64Slice(v2))
  3462. for _, k2 := range v2 {
  3463. if e.esep {
  3464. e.e.WriteMapElemKey()
  3465. }
  3466. e.encode(uintptr(k2))
  3467. if e.esep {
  3468. e.e.WriteMapElemValue()
  3469. }
  3470. e.e.EncodeFloat32(v[uintptr(k2)])
  3471. }
  3472. } else {
  3473. for k2, v2 := range v {
  3474. if e.esep {
  3475. e.e.WriteMapElemKey()
  3476. }
  3477. e.encode(k2)
  3478. if e.esep {
  3479. e.e.WriteMapElemValue()
  3480. }
  3481. e.e.EncodeFloat32(v2)
  3482. }
  3483. }
  3484. e.e.WriteMapEnd()
  3485. }
  3486. func (e *Encoder) fastpathEncMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) {
  3487. fastpathTV.EncMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), e)
  3488. }
  3489. func (fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, e *Encoder) {
  3490. if v == nil {
  3491. e.e.EncodeNil()
  3492. return
  3493. }
  3494. e.e.WriteMapStart(len(v))
  3495. if e.h.Canonical {
  3496. v2 := make([]uint64, len(v))
  3497. var i uint
  3498. for k := range v {
  3499. v2[i] = uint64(k)
  3500. i++
  3501. }
  3502. sort.Sort(uint64Slice(v2))
  3503. for _, k2 := range v2 {
  3504. if e.esep {
  3505. e.e.WriteMapElemKey()
  3506. }
  3507. e.encode(uintptr(k2))
  3508. if e.esep {
  3509. e.e.WriteMapElemValue()
  3510. }
  3511. e.e.EncodeFloat64(v[uintptr(k2)])
  3512. }
  3513. } else {
  3514. for k2, v2 := range v {
  3515. if e.esep {
  3516. e.e.WriteMapElemKey()
  3517. }
  3518. e.encode(k2)
  3519. if e.esep {
  3520. e.e.WriteMapElemValue()
  3521. }
  3522. e.e.EncodeFloat64(v2)
  3523. }
  3524. }
  3525. e.e.WriteMapEnd()
  3526. }
  3527. func (e *Encoder) fastpathEncMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) {
  3528. fastpathTV.EncMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), e)
  3529. }
  3530. func (fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, e *Encoder) {
  3531. if v == nil {
  3532. e.e.EncodeNil()
  3533. return
  3534. }
  3535. e.e.WriteMapStart(len(v))
  3536. if e.h.Canonical {
  3537. v2 := make([]uint64, len(v))
  3538. var i uint
  3539. for k := range v {
  3540. v2[i] = uint64(k)
  3541. i++
  3542. }
  3543. sort.Sort(uint64Slice(v2))
  3544. for _, k2 := range v2 {
  3545. if e.esep {
  3546. e.e.WriteMapElemKey()
  3547. }
  3548. e.encode(uintptr(k2))
  3549. if e.esep {
  3550. e.e.WriteMapElemValue()
  3551. }
  3552. e.e.EncodeBool(v[uintptr(k2)])
  3553. }
  3554. } else {
  3555. for k2, v2 := range v {
  3556. if e.esep {
  3557. e.e.WriteMapElemKey()
  3558. }
  3559. e.encode(k2)
  3560. if e.esep {
  3561. e.e.WriteMapElemValue()
  3562. }
  3563. e.e.EncodeBool(v2)
  3564. }
  3565. }
  3566. e.e.WriteMapEnd()
  3567. }
  3568. func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  3569. fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e)
  3570. }
  3571. func (fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) {
  3572. if v == nil {
  3573. e.e.EncodeNil()
  3574. return
  3575. }
  3576. e.e.WriteMapStart(len(v))
  3577. if e.h.Canonical {
  3578. v2 := make([]int64, len(v))
  3579. var i uint
  3580. for k := range v {
  3581. v2[i] = int64(k)
  3582. i++
  3583. }
  3584. sort.Sort(int64Slice(v2))
  3585. for _, k2 := range v2 {
  3586. if e.esep {
  3587. e.e.WriteMapElemKey()
  3588. }
  3589. e.e.EncodeInt(int64(int(k2)))
  3590. if e.esep {
  3591. e.e.WriteMapElemValue()
  3592. }
  3593. e.encode(v[int(k2)])
  3594. }
  3595. } else {
  3596. for k2, v2 := range v {
  3597. if e.esep {
  3598. e.e.WriteMapElemKey()
  3599. }
  3600. e.e.EncodeInt(int64(k2))
  3601. if e.esep {
  3602. e.e.WriteMapElemValue()
  3603. }
  3604. e.encode(v2)
  3605. }
  3606. }
  3607. e.e.WriteMapEnd()
  3608. }
  3609. func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  3610. fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e)
  3611. }
  3612. func (fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) {
  3613. if v == nil {
  3614. e.e.EncodeNil()
  3615. return
  3616. }
  3617. e.e.WriteMapStart(len(v))
  3618. if e.h.Canonical {
  3619. v2 := make([]int64, len(v))
  3620. var i uint
  3621. for k := range v {
  3622. v2[i] = int64(k)
  3623. i++
  3624. }
  3625. sort.Sort(int64Slice(v2))
  3626. for _, k2 := range v2 {
  3627. if e.esep {
  3628. e.e.WriteMapElemKey()
  3629. }
  3630. e.e.EncodeInt(int64(int(k2)))
  3631. if e.esep {
  3632. e.e.WriteMapElemValue()
  3633. }
  3634. if e.h.StringToRaw {
  3635. e.e.EncodeStringBytesRaw(bytesView(v[int(k2)]))
  3636. } else {
  3637. e.e.EncodeStringEnc(cUTF8, v[int(k2)])
  3638. }
  3639. }
  3640. } else {
  3641. for k2, v2 := range v {
  3642. if e.esep {
  3643. e.e.WriteMapElemKey()
  3644. }
  3645. e.e.EncodeInt(int64(k2))
  3646. if e.esep {
  3647. e.e.WriteMapElemValue()
  3648. }
  3649. if e.h.StringToRaw {
  3650. e.e.EncodeStringBytesRaw(bytesView(v2))
  3651. } else {
  3652. e.e.EncodeStringEnc(cUTF8, v2)
  3653. }
  3654. }
  3655. }
  3656. e.e.WriteMapEnd()
  3657. }
  3658. func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  3659. fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e)
  3660. }
  3661. func (fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) {
  3662. if v == nil {
  3663. e.e.EncodeNil()
  3664. return
  3665. }
  3666. e.e.WriteMapStart(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] = int64(k)
  3672. i++
  3673. }
  3674. sort.Sort(int64Slice(v2))
  3675. for _, k2 := range v2 {
  3676. if e.esep {
  3677. e.e.WriteMapElemKey()
  3678. }
  3679. e.e.EncodeInt(int64(int(k2)))
  3680. if e.esep {
  3681. e.e.WriteMapElemValue()
  3682. }
  3683. e.e.EncodeUint(uint64(v[int(k2)]))
  3684. }
  3685. } else {
  3686. for k2, v2 := range v {
  3687. if e.esep {
  3688. e.e.WriteMapElemKey()
  3689. }
  3690. e.e.EncodeInt(int64(k2))
  3691. if e.esep {
  3692. e.e.WriteMapElemValue()
  3693. }
  3694. e.e.EncodeUint(uint64(v2))
  3695. }
  3696. }
  3697. e.e.WriteMapEnd()
  3698. }
  3699. func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  3700. fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e)
  3701. }
  3702. func (fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) {
  3703. if v == nil {
  3704. e.e.EncodeNil()
  3705. return
  3706. }
  3707. e.e.WriteMapStart(len(v))
  3708. if e.h.Canonical {
  3709. v2 := make([]int64, len(v))
  3710. var i uint
  3711. for k := range v {
  3712. v2[i] = int64(k)
  3713. i++
  3714. }
  3715. sort.Sort(int64Slice(v2))
  3716. for _, k2 := range v2 {
  3717. if e.esep {
  3718. e.e.WriteMapElemKey()
  3719. }
  3720. e.e.EncodeInt(int64(int(k2)))
  3721. if e.esep {
  3722. e.e.WriteMapElemValue()
  3723. }
  3724. e.e.EncodeUint(uint64(v[int(k2)]))
  3725. }
  3726. } else {
  3727. for k2, v2 := range v {
  3728. if e.esep {
  3729. e.e.WriteMapElemKey()
  3730. }
  3731. e.e.EncodeInt(int64(k2))
  3732. if e.esep {
  3733. e.e.WriteMapElemValue()
  3734. }
  3735. e.e.EncodeUint(uint64(v2))
  3736. }
  3737. }
  3738. e.e.WriteMapEnd()
  3739. }
  3740. func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  3741. fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e)
  3742. }
  3743. func (fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) {
  3744. if v == nil {
  3745. e.e.EncodeNil()
  3746. return
  3747. }
  3748. e.e.WriteMapStart(len(v))
  3749. if e.h.Canonical {
  3750. v2 := make([]int64, len(v))
  3751. var i uint
  3752. for k := range v {
  3753. v2[i] = int64(k)
  3754. i++
  3755. }
  3756. sort.Sort(int64Slice(v2))
  3757. for _, k2 := range v2 {
  3758. if e.esep {
  3759. e.e.WriteMapElemKey()
  3760. }
  3761. e.e.EncodeInt(int64(int(k2)))
  3762. if e.esep {
  3763. e.e.WriteMapElemValue()
  3764. }
  3765. e.e.EncodeUint(v[int(k2)])
  3766. }
  3767. } else {
  3768. for k2, v2 := range v {
  3769. if e.esep {
  3770. e.e.WriteMapElemKey()
  3771. }
  3772. e.e.EncodeInt(int64(k2))
  3773. if e.esep {
  3774. e.e.WriteMapElemValue()
  3775. }
  3776. e.e.EncodeUint(v2)
  3777. }
  3778. }
  3779. e.e.WriteMapEnd()
  3780. }
  3781. func (e *Encoder) fastpathEncMapIntUintptrR(f *codecFnInfo, rv reflect.Value) {
  3782. fastpathTV.EncMapIntUintptrV(rv2i(rv).(map[int]uintptr), e)
  3783. }
  3784. func (fastpathT) EncMapIntUintptrV(v map[int]uintptr, e *Encoder) {
  3785. if v == nil {
  3786. e.e.EncodeNil()
  3787. return
  3788. }
  3789. e.e.WriteMapStart(len(v))
  3790. if e.h.Canonical {
  3791. v2 := make([]int64, len(v))
  3792. var i uint
  3793. for k := range v {
  3794. v2[i] = int64(k)
  3795. i++
  3796. }
  3797. sort.Sort(int64Slice(v2))
  3798. for _, k2 := range v2 {
  3799. if e.esep {
  3800. e.e.WriteMapElemKey()
  3801. }
  3802. e.e.EncodeInt(int64(int(k2)))
  3803. if e.esep {
  3804. e.e.WriteMapElemValue()
  3805. }
  3806. e.encode(v[int(k2)])
  3807. }
  3808. } else {
  3809. for k2, v2 := range v {
  3810. if e.esep {
  3811. e.e.WriteMapElemKey()
  3812. }
  3813. e.e.EncodeInt(int64(k2))
  3814. if e.esep {
  3815. e.e.WriteMapElemValue()
  3816. }
  3817. e.encode(v2)
  3818. }
  3819. }
  3820. e.e.WriteMapEnd()
  3821. }
  3822. func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  3823. fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e)
  3824. }
  3825. func (fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) {
  3826. if v == nil {
  3827. e.e.EncodeNil()
  3828. return
  3829. }
  3830. e.e.WriteMapStart(len(v))
  3831. if e.h.Canonical {
  3832. v2 := make([]int64, len(v))
  3833. var i uint
  3834. for k := range v {
  3835. v2[i] = int64(k)
  3836. i++
  3837. }
  3838. sort.Sort(int64Slice(v2))
  3839. for _, k2 := range v2 {
  3840. if e.esep {
  3841. e.e.WriteMapElemKey()
  3842. }
  3843. e.e.EncodeInt(int64(int(k2)))
  3844. if e.esep {
  3845. e.e.WriteMapElemValue()
  3846. }
  3847. e.e.EncodeInt(int64(v[int(k2)]))
  3848. }
  3849. } else {
  3850. for k2, v2 := range v {
  3851. if e.esep {
  3852. e.e.WriteMapElemKey()
  3853. }
  3854. e.e.EncodeInt(int64(k2))
  3855. if e.esep {
  3856. e.e.WriteMapElemValue()
  3857. }
  3858. e.e.EncodeInt(int64(v2))
  3859. }
  3860. }
  3861. e.e.WriteMapEnd()
  3862. }
  3863. func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  3864. fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e)
  3865. }
  3866. func (fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) {
  3867. if v == nil {
  3868. e.e.EncodeNil()
  3869. return
  3870. }
  3871. e.e.WriteMapStart(len(v))
  3872. if e.h.Canonical {
  3873. v2 := make([]int64, len(v))
  3874. var i uint
  3875. for k := range v {
  3876. v2[i] = int64(k)
  3877. i++
  3878. }
  3879. sort.Sort(int64Slice(v2))
  3880. for _, k2 := range v2 {
  3881. if e.esep {
  3882. e.e.WriteMapElemKey()
  3883. }
  3884. e.e.EncodeInt(int64(int(k2)))
  3885. if e.esep {
  3886. e.e.WriteMapElemValue()
  3887. }
  3888. e.e.EncodeInt(v[int(k2)])
  3889. }
  3890. } else {
  3891. for k2, v2 := range v {
  3892. if e.esep {
  3893. e.e.WriteMapElemKey()
  3894. }
  3895. e.e.EncodeInt(int64(k2))
  3896. if e.esep {
  3897. e.e.WriteMapElemValue()
  3898. }
  3899. e.e.EncodeInt(v2)
  3900. }
  3901. }
  3902. e.e.WriteMapEnd()
  3903. }
  3904. func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  3905. fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e)
  3906. }
  3907. func (fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) {
  3908. if v == nil {
  3909. e.e.EncodeNil()
  3910. return
  3911. }
  3912. e.e.WriteMapStart(len(v))
  3913. if e.h.Canonical {
  3914. v2 := make([]int64, len(v))
  3915. var i uint
  3916. for k := range v {
  3917. v2[i] = int64(k)
  3918. i++
  3919. }
  3920. sort.Sort(int64Slice(v2))
  3921. for _, k2 := range v2 {
  3922. if e.esep {
  3923. e.e.WriteMapElemKey()
  3924. }
  3925. e.e.EncodeInt(int64(int(k2)))
  3926. if e.esep {
  3927. e.e.WriteMapElemValue()
  3928. }
  3929. e.e.EncodeFloat32(v[int(k2)])
  3930. }
  3931. } else {
  3932. for k2, v2 := range v {
  3933. if e.esep {
  3934. e.e.WriteMapElemKey()
  3935. }
  3936. e.e.EncodeInt(int64(k2))
  3937. if e.esep {
  3938. e.e.WriteMapElemValue()
  3939. }
  3940. e.e.EncodeFloat32(v2)
  3941. }
  3942. }
  3943. e.e.WriteMapEnd()
  3944. }
  3945. func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  3946. fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e)
  3947. }
  3948. func (fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) {
  3949. if v == nil {
  3950. e.e.EncodeNil()
  3951. return
  3952. }
  3953. e.e.WriteMapStart(len(v))
  3954. if e.h.Canonical {
  3955. v2 := make([]int64, len(v))
  3956. var i uint
  3957. for k := range v {
  3958. v2[i] = int64(k)
  3959. i++
  3960. }
  3961. sort.Sort(int64Slice(v2))
  3962. for _, k2 := range v2 {
  3963. if e.esep {
  3964. e.e.WriteMapElemKey()
  3965. }
  3966. e.e.EncodeInt(int64(int(k2)))
  3967. if e.esep {
  3968. e.e.WriteMapElemValue()
  3969. }
  3970. e.e.EncodeFloat64(v[int(k2)])
  3971. }
  3972. } else {
  3973. for k2, v2 := range v {
  3974. if e.esep {
  3975. e.e.WriteMapElemKey()
  3976. }
  3977. e.e.EncodeInt(int64(k2))
  3978. if e.esep {
  3979. e.e.WriteMapElemValue()
  3980. }
  3981. e.e.EncodeFloat64(v2)
  3982. }
  3983. }
  3984. e.e.WriteMapEnd()
  3985. }
  3986. func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  3987. fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e)
  3988. }
  3989. func (fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) {
  3990. if v == nil {
  3991. e.e.EncodeNil()
  3992. return
  3993. }
  3994. e.e.WriteMapStart(len(v))
  3995. if e.h.Canonical {
  3996. v2 := make([]int64, len(v))
  3997. var i uint
  3998. for k := range v {
  3999. v2[i] = int64(k)
  4000. i++
  4001. }
  4002. sort.Sort(int64Slice(v2))
  4003. for _, k2 := range v2 {
  4004. if e.esep {
  4005. e.e.WriteMapElemKey()
  4006. }
  4007. e.e.EncodeInt(int64(int(k2)))
  4008. if e.esep {
  4009. e.e.WriteMapElemValue()
  4010. }
  4011. e.e.EncodeBool(v[int(k2)])
  4012. }
  4013. } else {
  4014. for k2, v2 := range v {
  4015. if e.esep {
  4016. e.e.WriteMapElemKey()
  4017. }
  4018. e.e.EncodeInt(int64(k2))
  4019. if e.esep {
  4020. e.e.WriteMapElemValue()
  4021. }
  4022. e.e.EncodeBool(v2)
  4023. }
  4024. }
  4025. e.e.WriteMapEnd()
  4026. }
  4027. func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  4028. fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e)
  4029. }
  4030. func (fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) {
  4031. if v == nil {
  4032. e.e.EncodeNil()
  4033. return
  4034. }
  4035. e.e.WriteMapStart(len(v))
  4036. if e.h.Canonical {
  4037. v2 := make([]int64, len(v))
  4038. var i uint
  4039. for k := range v {
  4040. v2[i] = k
  4041. i++
  4042. }
  4043. sort.Sort(int64Slice(v2))
  4044. for _, k2 := range v2 {
  4045. if e.esep {
  4046. e.e.WriteMapElemKey()
  4047. }
  4048. e.e.EncodeInt(k2)
  4049. if e.esep {
  4050. e.e.WriteMapElemValue()
  4051. }
  4052. e.encode(v[k2])
  4053. }
  4054. } else {
  4055. for k2, v2 := range v {
  4056. if e.esep {
  4057. e.e.WriteMapElemKey()
  4058. }
  4059. e.e.EncodeInt(k2)
  4060. if e.esep {
  4061. e.e.WriteMapElemValue()
  4062. }
  4063. e.encode(v2)
  4064. }
  4065. }
  4066. e.e.WriteMapEnd()
  4067. }
  4068. func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  4069. fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e)
  4070. }
  4071. func (fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) {
  4072. if v == nil {
  4073. e.e.EncodeNil()
  4074. return
  4075. }
  4076. e.e.WriteMapStart(len(v))
  4077. if e.h.Canonical {
  4078. v2 := make([]int64, len(v))
  4079. var i uint
  4080. for k := range v {
  4081. v2[i] = k
  4082. i++
  4083. }
  4084. sort.Sort(int64Slice(v2))
  4085. for _, k2 := range v2 {
  4086. if e.esep {
  4087. e.e.WriteMapElemKey()
  4088. }
  4089. e.e.EncodeInt(k2)
  4090. if e.esep {
  4091. e.e.WriteMapElemValue()
  4092. }
  4093. if e.h.StringToRaw {
  4094. e.e.EncodeStringBytesRaw(bytesView(v[k2]))
  4095. } else {
  4096. e.e.EncodeStringEnc(cUTF8, v[k2])
  4097. }
  4098. }
  4099. } else {
  4100. for k2, v2 := range v {
  4101. if e.esep {
  4102. e.e.WriteMapElemKey()
  4103. }
  4104. e.e.EncodeInt(k2)
  4105. if e.esep {
  4106. e.e.WriteMapElemValue()
  4107. }
  4108. if e.h.StringToRaw {
  4109. e.e.EncodeStringBytesRaw(bytesView(v2))
  4110. } else {
  4111. e.e.EncodeStringEnc(cUTF8, v2)
  4112. }
  4113. }
  4114. }
  4115. e.e.WriteMapEnd()
  4116. }
  4117. func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  4118. fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e)
  4119. }
  4120. func (fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) {
  4121. if v == nil {
  4122. e.e.EncodeNil()
  4123. return
  4124. }
  4125. e.e.WriteMapStart(len(v))
  4126. if e.h.Canonical {
  4127. v2 := make([]int64, len(v))
  4128. var i uint
  4129. for k := range v {
  4130. v2[i] = k
  4131. i++
  4132. }
  4133. sort.Sort(int64Slice(v2))
  4134. for _, k2 := range v2 {
  4135. if e.esep {
  4136. e.e.WriteMapElemKey()
  4137. }
  4138. e.e.EncodeInt(k2)
  4139. if e.esep {
  4140. e.e.WriteMapElemValue()
  4141. }
  4142. e.e.EncodeUint(uint64(v[k2]))
  4143. }
  4144. } else {
  4145. for k2, v2 := range v {
  4146. if e.esep {
  4147. e.e.WriteMapElemKey()
  4148. }
  4149. e.e.EncodeInt(k2)
  4150. if e.esep {
  4151. e.e.WriteMapElemValue()
  4152. }
  4153. e.e.EncodeUint(uint64(v2))
  4154. }
  4155. }
  4156. e.e.WriteMapEnd()
  4157. }
  4158. func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  4159. fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e)
  4160. }
  4161. func (fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) {
  4162. if v == nil {
  4163. e.e.EncodeNil()
  4164. return
  4165. }
  4166. e.e.WriteMapStart(len(v))
  4167. if e.h.Canonical {
  4168. v2 := make([]int64, len(v))
  4169. var i uint
  4170. for k := range v {
  4171. v2[i] = k
  4172. i++
  4173. }
  4174. sort.Sort(int64Slice(v2))
  4175. for _, k2 := range v2 {
  4176. if e.esep {
  4177. e.e.WriteMapElemKey()
  4178. }
  4179. e.e.EncodeInt(k2)
  4180. if e.esep {
  4181. e.e.WriteMapElemValue()
  4182. }
  4183. e.e.EncodeUint(uint64(v[k2]))
  4184. }
  4185. } else {
  4186. for k2, v2 := range v {
  4187. if e.esep {
  4188. e.e.WriteMapElemKey()
  4189. }
  4190. e.e.EncodeInt(k2)
  4191. if e.esep {
  4192. e.e.WriteMapElemValue()
  4193. }
  4194. e.e.EncodeUint(uint64(v2))
  4195. }
  4196. }
  4197. e.e.WriteMapEnd()
  4198. }
  4199. func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  4200. fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e)
  4201. }
  4202. func (fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) {
  4203. if v == nil {
  4204. e.e.EncodeNil()
  4205. return
  4206. }
  4207. e.e.WriteMapStart(len(v))
  4208. if e.h.Canonical {
  4209. v2 := make([]int64, len(v))
  4210. var i uint
  4211. for k := range v {
  4212. v2[i] = k
  4213. i++
  4214. }
  4215. sort.Sort(int64Slice(v2))
  4216. for _, k2 := range v2 {
  4217. if e.esep {
  4218. e.e.WriteMapElemKey()
  4219. }
  4220. e.e.EncodeInt(k2)
  4221. if e.esep {
  4222. e.e.WriteMapElemValue()
  4223. }
  4224. e.e.EncodeUint(v[k2])
  4225. }
  4226. } else {
  4227. for k2, v2 := range v {
  4228. if e.esep {
  4229. e.e.WriteMapElemKey()
  4230. }
  4231. e.e.EncodeInt(k2)
  4232. if e.esep {
  4233. e.e.WriteMapElemValue()
  4234. }
  4235. e.e.EncodeUint(v2)
  4236. }
  4237. }
  4238. e.e.WriteMapEnd()
  4239. }
  4240. func (e *Encoder) fastpathEncMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) {
  4241. fastpathTV.EncMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), e)
  4242. }
  4243. func (fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, e *Encoder) {
  4244. if v == nil {
  4245. e.e.EncodeNil()
  4246. return
  4247. }
  4248. e.e.WriteMapStart(len(v))
  4249. if e.h.Canonical {
  4250. v2 := make([]int64, len(v))
  4251. var i uint
  4252. for k := range v {
  4253. v2[i] = k
  4254. i++
  4255. }
  4256. sort.Sort(int64Slice(v2))
  4257. for _, k2 := range v2 {
  4258. if e.esep {
  4259. e.e.WriteMapElemKey()
  4260. }
  4261. e.e.EncodeInt(k2)
  4262. if e.esep {
  4263. e.e.WriteMapElemValue()
  4264. }
  4265. e.encode(v[k2])
  4266. }
  4267. } else {
  4268. for k2, v2 := range v {
  4269. if e.esep {
  4270. e.e.WriteMapElemKey()
  4271. }
  4272. e.e.EncodeInt(k2)
  4273. if e.esep {
  4274. e.e.WriteMapElemValue()
  4275. }
  4276. e.encode(v2)
  4277. }
  4278. }
  4279. e.e.WriteMapEnd()
  4280. }
  4281. func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  4282. fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e)
  4283. }
  4284. func (fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) {
  4285. if v == nil {
  4286. e.e.EncodeNil()
  4287. return
  4288. }
  4289. e.e.WriteMapStart(len(v))
  4290. if e.h.Canonical {
  4291. v2 := make([]int64, len(v))
  4292. var i uint
  4293. for k := range v {
  4294. v2[i] = k
  4295. i++
  4296. }
  4297. sort.Sort(int64Slice(v2))
  4298. for _, k2 := range v2 {
  4299. if e.esep {
  4300. e.e.WriteMapElemKey()
  4301. }
  4302. e.e.EncodeInt(k2)
  4303. if e.esep {
  4304. e.e.WriteMapElemValue()
  4305. }
  4306. e.e.EncodeInt(int64(v[k2]))
  4307. }
  4308. } else {
  4309. for k2, v2 := range v {
  4310. if e.esep {
  4311. e.e.WriteMapElemKey()
  4312. }
  4313. e.e.EncodeInt(k2)
  4314. if e.esep {
  4315. e.e.WriteMapElemValue()
  4316. }
  4317. e.e.EncodeInt(int64(v2))
  4318. }
  4319. }
  4320. e.e.WriteMapEnd()
  4321. }
  4322. func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  4323. fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e)
  4324. }
  4325. func (fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) {
  4326. if v == nil {
  4327. e.e.EncodeNil()
  4328. return
  4329. }
  4330. e.e.WriteMapStart(len(v))
  4331. if e.h.Canonical {
  4332. v2 := make([]int64, len(v))
  4333. var i uint
  4334. for k := range v {
  4335. v2[i] = k
  4336. i++
  4337. }
  4338. sort.Sort(int64Slice(v2))
  4339. for _, k2 := range v2 {
  4340. if e.esep {
  4341. e.e.WriteMapElemKey()
  4342. }
  4343. e.e.EncodeInt(k2)
  4344. if e.esep {
  4345. e.e.WriteMapElemValue()
  4346. }
  4347. e.e.EncodeInt(v[k2])
  4348. }
  4349. } else {
  4350. for k2, v2 := range v {
  4351. if e.esep {
  4352. e.e.WriteMapElemKey()
  4353. }
  4354. e.e.EncodeInt(k2)
  4355. if e.esep {
  4356. e.e.WriteMapElemValue()
  4357. }
  4358. e.e.EncodeInt(v2)
  4359. }
  4360. }
  4361. e.e.WriteMapEnd()
  4362. }
  4363. func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  4364. fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e)
  4365. }
  4366. func (fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) {
  4367. if v == nil {
  4368. e.e.EncodeNil()
  4369. return
  4370. }
  4371. e.e.WriteMapStart(len(v))
  4372. if e.h.Canonical {
  4373. v2 := make([]int64, len(v))
  4374. var i uint
  4375. for k := range v {
  4376. v2[i] = k
  4377. i++
  4378. }
  4379. sort.Sort(int64Slice(v2))
  4380. for _, k2 := range v2 {
  4381. if e.esep {
  4382. e.e.WriteMapElemKey()
  4383. }
  4384. e.e.EncodeInt(k2)
  4385. if e.esep {
  4386. e.e.WriteMapElemValue()
  4387. }
  4388. e.e.EncodeFloat32(v[k2])
  4389. }
  4390. } else {
  4391. for k2, v2 := range v {
  4392. if e.esep {
  4393. e.e.WriteMapElemKey()
  4394. }
  4395. e.e.EncodeInt(k2)
  4396. if e.esep {
  4397. e.e.WriteMapElemValue()
  4398. }
  4399. e.e.EncodeFloat32(v2)
  4400. }
  4401. }
  4402. e.e.WriteMapEnd()
  4403. }
  4404. func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  4405. fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e)
  4406. }
  4407. func (fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) {
  4408. if v == nil {
  4409. e.e.EncodeNil()
  4410. return
  4411. }
  4412. e.e.WriteMapStart(len(v))
  4413. if e.h.Canonical {
  4414. v2 := make([]int64, len(v))
  4415. var i uint
  4416. for k := range v {
  4417. v2[i] = k
  4418. i++
  4419. }
  4420. sort.Sort(int64Slice(v2))
  4421. for _, k2 := range v2 {
  4422. if e.esep {
  4423. e.e.WriteMapElemKey()
  4424. }
  4425. e.e.EncodeInt(k2)
  4426. if e.esep {
  4427. e.e.WriteMapElemValue()
  4428. }
  4429. e.e.EncodeFloat64(v[k2])
  4430. }
  4431. } else {
  4432. for k2, v2 := range v {
  4433. if e.esep {
  4434. e.e.WriteMapElemKey()
  4435. }
  4436. e.e.EncodeInt(k2)
  4437. if e.esep {
  4438. e.e.WriteMapElemValue()
  4439. }
  4440. e.e.EncodeFloat64(v2)
  4441. }
  4442. }
  4443. e.e.WriteMapEnd()
  4444. }
  4445. func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  4446. fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e)
  4447. }
  4448. func (fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) {
  4449. if v == nil {
  4450. e.e.EncodeNil()
  4451. return
  4452. }
  4453. e.e.WriteMapStart(len(v))
  4454. if e.h.Canonical {
  4455. v2 := make([]int64, len(v))
  4456. var i uint
  4457. for k := range v {
  4458. v2[i] = k
  4459. i++
  4460. }
  4461. sort.Sort(int64Slice(v2))
  4462. for _, k2 := range v2 {
  4463. if e.esep {
  4464. e.e.WriteMapElemKey()
  4465. }
  4466. e.e.EncodeInt(k2)
  4467. if e.esep {
  4468. e.e.WriteMapElemValue()
  4469. }
  4470. e.e.EncodeBool(v[k2])
  4471. }
  4472. } else {
  4473. for k2, v2 := range v {
  4474. if e.esep {
  4475. e.e.WriteMapElemKey()
  4476. }
  4477. e.e.EncodeInt(k2)
  4478. if e.esep {
  4479. e.e.WriteMapElemValue()
  4480. }
  4481. e.e.EncodeBool(v2)
  4482. }
  4483. }
  4484. e.e.WriteMapEnd()
  4485. }
  4486. // -- decode
  4487. // -- -- fast path type switch
  4488. func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
  4489. var changed bool
  4490. switch v := iv.(type) {
  4491. case []interface{}:
  4492. var v2 []interface{}
  4493. v2, changed = fastpathTV.DecSliceIntfV(v, false, d)
  4494. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4495. copy(v, v2)
  4496. }
  4497. case *[]interface{}:
  4498. var v2 []interface{}
  4499. v2, changed = fastpathTV.DecSliceIntfV(*v, true, d)
  4500. if changed {
  4501. *v = v2
  4502. }
  4503. case []string:
  4504. var v2 []string
  4505. v2, changed = fastpathTV.DecSliceStringV(v, false, d)
  4506. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4507. copy(v, v2)
  4508. }
  4509. case *[]string:
  4510. var v2 []string
  4511. v2, changed = fastpathTV.DecSliceStringV(*v, true, d)
  4512. if changed {
  4513. *v = v2
  4514. }
  4515. case []float32:
  4516. var v2 []float32
  4517. v2, changed = fastpathTV.DecSliceFloat32V(v, false, d)
  4518. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4519. copy(v, v2)
  4520. }
  4521. case *[]float32:
  4522. var v2 []float32
  4523. v2, changed = fastpathTV.DecSliceFloat32V(*v, true, d)
  4524. if changed {
  4525. *v = v2
  4526. }
  4527. case []float64:
  4528. var v2 []float64
  4529. v2, changed = fastpathTV.DecSliceFloat64V(v, false, d)
  4530. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4531. copy(v, v2)
  4532. }
  4533. case *[]float64:
  4534. var v2 []float64
  4535. v2, changed = fastpathTV.DecSliceFloat64V(*v, true, d)
  4536. if changed {
  4537. *v = v2
  4538. }
  4539. case []uint:
  4540. var v2 []uint
  4541. v2, changed = fastpathTV.DecSliceUintV(v, false, d)
  4542. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4543. copy(v, v2)
  4544. }
  4545. case *[]uint:
  4546. var v2 []uint
  4547. v2, changed = fastpathTV.DecSliceUintV(*v, true, d)
  4548. if changed {
  4549. *v = v2
  4550. }
  4551. case []uint16:
  4552. var v2 []uint16
  4553. v2, changed = fastpathTV.DecSliceUint16V(v, false, d)
  4554. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4555. copy(v, v2)
  4556. }
  4557. case *[]uint16:
  4558. var v2 []uint16
  4559. v2, changed = fastpathTV.DecSliceUint16V(*v, true, d)
  4560. if changed {
  4561. *v = v2
  4562. }
  4563. case []uint32:
  4564. var v2 []uint32
  4565. v2, changed = fastpathTV.DecSliceUint32V(v, false, d)
  4566. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4567. copy(v, v2)
  4568. }
  4569. case *[]uint32:
  4570. var v2 []uint32
  4571. v2, changed = fastpathTV.DecSliceUint32V(*v, true, d)
  4572. if changed {
  4573. *v = v2
  4574. }
  4575. case []uint64:
  4576. var v2 []uint64
  4577. v2, changed = fastpathTV.DecSliceUint64V(v, false, d)
  4578. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4579. copy(v, v2)
  4580. }
  4581. case *[]uint64:
  4582. var v2 []uint64
  4583. v2, changed = fastpathTV.DecSliceUint64V(*v, true, d)
  4584. if changed {
  4585. *v = v2
  4586. }
  4587. case []uintptr:
  4588. var v2 []uintptr
  4589. v2, changed = fastpathTV.DecSliceUintptrV(v, false, d)
  4590. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4591. copy(v, v2)
  4592. }
  4593. case *[]uintptr:
  4594. var v2 []uintptr
  4595. v2, changed = fastpathTV.DecSliceUintptrV(*v, true, d)
  4596. if changed {
  4597. *v = v2
  4598. }
  4599. case []int:
  4600. var v2 []int
  4601. v2, changed = fastpathTV.DecSliceIntV(v, false, d)
  4602. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4603. copy(v, v2)
  4604. }
  4605. case *[]int:
  4606. var v2 []int
  4607. v2, changed = fastpathTV.DecSliceIntV(*v, true, d)
  4608. if changed {
  4609. *v = v2
  4610. }
  4611. case []int8:
  4612. var v2 []int8
  4613. v2, changed = fastpathTV.DecSliceInt8V(v, false, d)
  4614. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4615. copy(v, v2)
  4616. }
  4617. case *[]int8:
  4618. var v2 []int8
  4619. v2, changed = fastpathTV.DecSliceInt8V(*v, true, d)
  4620. if changed {
  4621. *v = v2
  4622. }
  4623. case []int16:
  4624. var v2 []int16
  4625. v2, changed = fastpathTV.DecSliceInt16V(v, false, d)
  4626. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4627. copy(v, v2)
  4628. }
  4629. case *[]int16:
  4630. var v2 []int16
  4631. v2, changed = fastpathTV.DecSliceInt16V(*v, true, d)
  4632. if changed {
  4633. *v = v2
  4634. }
  4635. case []int32:
  4636. var v2 []int32
  4637. v2, changed = fastpathTV.DecSliceInt32V(v, false, d)
  4638. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4639. copy(v, v2)
  4640. }
  4641. case *[]int32:
  4642. var v2 []int32
  4643. v2, changed = fastpathTV.DecSliceInt32V(*v, true, d)
  4644. if changed {
  4645. *v = v2
  4646. }
  4647. case []int64:
  4648. var v2 []int64
  4649. v2, changed = fastpathTV.DecSliceInt64V(v, false, d)
  4650. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4651. copy(v, v2)
  4652. }
  4653. case *[]int64:
  4654. var v2 []int64
  4655. v2, changed = fastpathTV.DecSliceInt64V(*v, true, d)
  4656. if changed {
  4657. *v = v2
  4658. }
  4659. case []bool:
  4660. var v2 []bool
  4661. v2, changed = fastpathTV.DecSliceBoolV(v, false, d)
  4662. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4663. copy(v, v2)
  4664. }
  4665. case *[]bool:
  4666. var v2 []bool
  4667. v2, changed = fastpathTV.DecSliceBoolV(*v, true, d)
  4668. if changed {
  4669. *v = v2
  4670. }
  4671. case map[string]interface{}:
  4672. fastpathTV.DecMapStringIntfV(v, false, d)
  4673. case *map[string]interface{}:
  4674. var v2 map[string]interface{}
  4675. v2, changed = fastpathTV.DecMapStringIntfV(*v, true, d)
  4676. if changed {
  4677. *v = v2
  4678. }
  4679. case map[string]string:
  4680. fastpathTV.DecMapStringStringV(v, false, d)
  4681. case *map[string]string:
  4682. var v2 map[string]string
  4683. v2, changed = fastpathTV.DecMapStringStringV(*v, true, d)
  4684. if changed {
  4685. *v = v2
  4686. }
  4687. case map[string]uint:
  4688. fastpathTV.DecMapStringUintV(v, false, d)
  4689. case *map[string]uint:
  4690. var v2 map[string]uint
  4691. v2, changed = fastpathTV.DecMapStringUintV(*v, true, d)
  4692. if changed {
  4693. *v = v2
  4694. }
  4695. case map[string]uint8:
  4696. fastpathTV.DecMapStringUint8V(v, false, d)
  4697. case *map[string]uint8:
  4698. var v2 map[string]uint8
  4699. v2, changed = fastpathTV.DecMapStringUint8V(*v, true, d)
  4700. if changed {
  4701. *v = v2
  4702. }
  4703. case map[string]uint64:
  4704. fastpathTV.DecMapStringUint64V(v, false, d)
  4705. case *map[string]uint64:
  4706. var v2 map[string]uint64
  4707. v2, changed = fastpathTV.DecMapStringUint64V(*v, true, d)
  4708. if changed {
  4709. *v = v2
  4710. }
  4711. case map[string]uintptr:
  4712. fastpathTV.DecMapStringUintptrV(v, false, d)
  4713. case *map[string]uintptr:
  4714. var v2 map[string]uintptr
  4715. v2, changed = fastpathTV.DecMapStringUintptrV(*v, true, d)
  4716. if changed {
  4717. *v = v2
  4718. }
  4719. case map[string]int:
  4720. fastpathTV.DecMapStringIntV(v, false, d)
  4721. case *map[string]int:
  4722. var v2 map[string]int
  4723. v2, changed = fastpathTV.DecMapStringIntV(*v, true, d)
  4724. if changed {
  4725. *v = v2
  4726. }
  4727. case map[string]int64:
  4728. fastpathTV.DecMapStringInt64V(v, false, d)
  4729. case *map[string]int64:
  4730. var v2 map[string]int64
  4731. v2, changed = fastpathTV.DecMapStringInt64V(*v, true, d)
  4732. if changed {
  4733. *v = v2
  4734. }
  4735. case map[string]float32:
  4736. fastpathTV.DecMapStringFloat32V(v, false, d)
  4737. case *map[string]float32:
  4738. var v2 map[string]float32
  4739. v2, changed = fastpathTV.DecMapStringFloat32V(*v, true, d)
  4740. if changed {
  4741. *v = v2
  4742. }
  4743. case map[string]float64:
  4744. fastpathTV.DecMapStringFloat64V(v, false, d)
  4745. case *map[string]float64:
  4746. var v2 map[string]float64
  4747. v2, changed = fastpathTV.DecMapStringFloat64V(*v, true, d)
  4748. if changed {
  4749. *v = v2
  4750. }
  4751. case map[string]bool:
  4752. fastpathTV.DecMapStringBoolV(v, false, d)
  4753. case *map[string]bool:
  4754. var v2 map[string]bool
  4755. v2, changed = fastpathTV.DecMapStringBoolV(*v, true, d)
  4756. if changed {
  4757. *v = v2
  4758. }
  4759. case map[uint]interface{}:
  4760. fastpathTV.DecMapUintIntfV(v, false, d)
  4761. case *map[uint]interface{}:
  4762. var v2 map[uint]interface{}
  4763. v2, changed = fastpathTV.DecMapUintIntfV(*v, true, d)
  4764. if changed {
  4765. *v = v2
  4766. }
  4767. case map[uint]string:
  4768. fastpathTV.DecMapUintStringV(v, false, d)
  4769. case *map[uint]string:
  4770. var v2 map[uint]string
  4771. v2, changed = fastpathTV.DecMapUintStringV(*v, true, d)
  4772. if changed {
  4773. *v = v2
  4774. }
  4775. case map[uint]uint:
  4776. fastpathTV.DecMapUintUintV(v, false, d)
  4777. case *map[uint]uint:
  4778. var v2 map[uint]uint
  4779. v2, changed = fastpathTV.DecMapUintUintV(*v, true, d)
  4780. if changed {
  4781. *v = v2
  4782. }
  4783. case map[uint]uint8:
  4784. fastpathTV.DecMapUintUint8V(v, false, d)
  4785. case *map[uint]uint8:
  4786. var v2 map[uint]uint8
  4787. v2, changed = fastpathTV.DecMapUintUint8V(*v, true, d)
  4788. if changed {
  4789. *v = v2
  4790. }
  4791. case map[uint]uint64:
  4792. fastpathTV.DecMapUintUint64V(v, false, d)
  4793. case *map[uint]uint64:
  4794. var v2 map[uint]uint64
  4795. v2, changed = fastpathTV.DecMapUintUint64V(*v, true, d)
  4796. if changed {
  4797. *v = v2
  4798. }
  4799. case map[uint]uintptr:
  4800. fastpathTV.DecMapUintUintptrV(v, false, d)
  4801. case *map[uint]uintptr:
  4802. var v2 map[uint]uintptr
  4803. v2, changed = fastpathTV.DecMapUintUintptrV(*v, true, d)
  4804. if changed {
  4805. *v = v2
  4806. }
  4807. case map[uint]int:
  4808. fastpathTV.DecMapUintIntV(v, false, d)
  4809. case *map[uint]int:
  4810. var v2 map[uint]int
  4811. v2, changed = fastpathTV.DecMapUintIntV(*v, true, d)
  4812. if changed {
  4813. *v = v2
  4814. }
  4815. case map[uint]int64:
  4816. fastpathTV.DecMapUintInt64V(v, false, d)
  4817. case *map[uint]int64:
  4818. var v2 map[uint]int64
  4819. v2, changed = fastpathTV.DecMapUintInt64V(*v, true, d)
  4820. if changed {
  4821. *v = v2
  4822. }
  4823. case map[uint]float32:
  4824. fastpathTV.DecMapUintFloat32V(v, false, d)
  4825. case *map[uint]float32:
  4826. var v2 map[uint]float32
  4827. v2, changed = fastpathTV.DecMapUintFloat32V(*v, true, d)
  4828. if changed {
  4829. *v = v2
  4830. }
  4831. case map[uint]float64:
  4832. fastpathTV.DecMapUintFloat64V(v, false, d)
  4833. case *map[uint]float64:
  4834. var v2 map[uint]float64
  4835. v2, changed = fastpathTV.DecMapUintFloat64V(*v, true, d)
  4836. if changed {
  4837. *v = v2
  4838. }
  4839. case map[uint]bool:
  4840. fastpathTV.DecMapUintBoolV(v, false, d)
  4841. case *map[uint]bool:
  4842. var v2 map[uint]bool
  4843. v2, changed = fastpathTV.DecMapUintBoolV(*v, true, d)
  4844. if changed {
  4845. *v = v2
  4846. }
  4847. case map[uint8]interface{}:
  4848. fastpathTV.DecMapUint8IntfV(v, false, d)
  4849. case *map[uint8]interface{}:
  4850. var v2 map[uint8]interface{}
  4851. v2, changed = fastpathTV.DecMapUint8IntfV(*v, true, d)
  4852. if changed {
  4853. *v = v2
  4854. }
  4855. case map[uint8]string:
  4856. fastpathTV.DecMapUint8StringV(v, false, d)
  4857. case *map[uint8]string:
  4858. var v2 map[uint8]string
  4859. v2, changed = fastpathTV.DecMapUint8StringV(*v, true, d)
  4860. if changed {
  4861. *v = v2
  4862. }
  4863. case map[uint8]uint:
  4864. fastpathTV.DecMapUint8UintV(v, false, d)
  4865. case *map[uint8]uint:
  4866. var v2 map[uint8]uint
  4867. v2, changed = fastpathTV.DecMapUint8UintV(*v, true, d)
  4868. if changed {
  4869. *v = v2
  4870. }
  4871. case map[uint8]uint8:
  4872. fastpathTV.DecMapUint8Uint8V(v, false, d)
  4873. case *map[uint8]uint8:
  4874. var v2 map[uint8]uint8
  4875. v2, changed = fastpathTV.DecMapUint8Uint8V(*v, true, d)
  4876. if changed {
  4877. *v = v2
  4878. }
  4879. case map[uint8]uint64:
  4880. fastpathTV.DecMapUint8Uint64V(v, false, d)
  4881. case *map[uint8]uint64:
  4882. var v2 map[uint8]uint64
  4883. v2, changed = fastpathTV.DecMapUint8Uint64V(*v, true, d)
  4884. if changed {
  4885. *v = v2
  4886. }
  4887. case map[uint8]uintptr:
  4888. fastpathTV.DecMapUint8UintptrV(v, false, d)
  4889. case *map[uint8]uintptr:
  4890. var v2 map[uint8]uintptr
  4891. v2, changed = fastpathTV.DecMapUint8UintptrV(*v, true, d)
  4892. if changed {
  4893. *v = v2
  4894. }
  4895. case map[uint8]int:
  4896. fastpathTV.DecMapUint8IntV(v, false, d)
  4897. case *map[uint8]int:
  4898. var v2 map[uint8]int
  4899. v2, changed = fastpathTV.DecMapUint8IntV(*v, true, d)
  4900. if changed {
  4901. *v = v2
  4902. }
  4903. case map[uint8]int64:
  4904. fastpathTV.DecMapUint8Int64V(v, false, d)
  4905. case *map[uint8]int64:
  4906. var v2 map[uint8]int64
  4907. v2, changed = fastpathTV.DecMapUint8Int64V(*v, true, d)
  4908. if changed {
  4909. *v = v2
  4910. }
  4911. case map[uint8]float32:
  4912. fastpathTV.DecMapUint8Float32V(v, false, d)
  4913. case *map[uint8]float32:
  4914. var v2 map[uint8]float32
  4915. v2, changed = fastpathTV.DecMapUint8Float32V(*v, true, d)
  4916. if changed {
  4917. *v = v2
  4918. }
  4919. case map[uint8]float64:
  4920. fastpathTV.DecMapUint8Float64V(v, false, d)
  4921. case *map[uint8]float64:
  4922. var v2 map[uint8]float64
  4923. v2, changed = fastpathTV.DecMapUint8Float64V(*v, true, d)
  4924. if changed {
  4925. *v = v2
  4926. }
  4927. case map[uint8]bool:
  4928. fastpathTV.DecMapUint8BoolV(v, false, d)
  4929. case *map[uint8]bool:
  4930. var v2 map[uint8]bool
  4931. v2, changed = fastpathTV.DecMapUint8BoolV(*v, true, d)
  4932. if changed {
  4933. *v = v2
  4934. }
  4935. case map[uint64]interface{}:
  4936. fastpathTV.DecMapUint64IntfV(v, false, d)
  4937. case *map[uint64]interface{}:
  4938. var v2 map[uint64]interface{}
  4939. v2, changed = fastpathTV.DecMapUint64IntfV(*v, true, d)
  4940. if changed {
  4941. *v = v2
  4942. }
  4943. case map[uint64]string:
  4944. fastpathTV.DecMapUint64StringV(v, false, d)
  4945. case *map[uint64]string:
  4946. var v2 map[uint64]string
  4947. v2, changed = fastpathTV.DecMapUint64StringV(*v, true, d)
  4948. if changed {
  4949. *v = v2
  4950. }
  4951. case map[uint64]uint:
  4952. fastpathTV.DecMapUint64UintV(v, false, d)
  4953. case *map[uint64]uint:
  4954. var v2 map[uint64]uint
  4955. v2, changed = fastpathTV.DecMapUint64UintV(*v, true, d)
  4956. if changed {
  4957. *v = v2
  4958. }
  4959. case map[uint64]uint8:
  4960. fastpathTV.DecMapUint64Uint8V(v, false, d)
  4961. case *map[uint64]uint8:
  4962. var v2 map[uint64]uint8
  4963. v2, changed = fastpathTV.DecMapUint64Uint8V(*v, true, d)
  4964. if changed {
  4965. *v = v2
  4966. }
  4967. case map[uint64]uint64:
  4968. fastpathTV.DecMapUint64Uint64V(v, false, d)
  4969. case *map[uint64]uint64:
  4970. var v2 map[uint64]uint64
  4971. v2, changed = fastpathTV.DecMapUint64Uint64V(*v, true, d)
  4972. if changed {
  4973. *v = v2
  4974. }
  4975. case map[uint64]uintptr:
  4976. fastpathTV.DecMapUint64UintptrV(v, false, d)
  4977. case *map[uint64]uintptr:
  4978. var v2 map[uint64]uintptr
  4979. v2, changed = fastpathTV.DecMapUint64UintptrV(*v, true, d)
  4980. if changed {
  4981. *v = v2
  4982. }
  4983. case map[uint64]int:
  4984. fastpathTV.DecMapUint64IntV(v, false, d)
  4985. case *map[uint64]int:
  4986. var v2 map[uint64]int
  4987. v2, changed = fastpathTV.DecMapUint64IntV(*v, true, d)
  4988. if changed {
  4989. *v = v2
  4990. }
  4991. case map[uint64]int64:
  4992. fastpathTV.DecMapUint64Int64V(v, false, d)
  4993. case *map[uint64]int64:
  4994. var v2 map[uint64]int64
  4995. v2, changed = fastpathTV.DecMapUint64Int64V(*v, true, d)
  4996. if changed {
  4997. *v = v2
  4998. }
  4999. case map[uint64]float32:
  5000. fastpathTV.DecMapUint64Float32V(v, false, d)
  5001. case *map[uint64]float32:
  5002. var v2 map[uint64]float32
  5003. v2, changed = fastpathTV.DecMapUint64Float32V(*v, true, d)
  5004. if changed {
  5005. *v = v2
  5006. }
  5007. case map[uint64]float64:
  5008. fastpathTV.DecMapUint64Float64V(v, false, d)
  5009. case *map[uint64]float64:
  5010. var v2 map[uint64]float64
  5011. v2, changed = fastpathTV.DecMapUint64Float64V(*v, true, d)
  5012. if changed {
  5013. *v = v2
  5014. }
  5015. case map[uint64]bool:
  5016. fastpathTV.DecMapUint64BoolV(v, false, d)
  5017. case *map[uint64]bool:
  5018. var v2 map[uint64]bool
  5019. v2, changed = fastpathTV.DecMapUint64BoolV(*v, true, d)
  5020. if changed {
  5021. *v = v2
  5022. }
  5023. case map[uintptr]interface{}:
  5024. fastpathTV.DecMapUintptrIntfV(v, false, d)
  5025. case *map[uintptr]interface{}:
  5026. var v2 map[uintptr]interface{}
  5027. v2, changed = fastpathTV.DecMapUintptrIntfV(*v, true, d)
  5028. if changed {
  5029. *v = v2
  5030. }
  5031. case map[uintptr]string:
  5032. fastpathTV.DecMapUintptrStringV(v, false, d)
  5033. case *map[uintptr]string:
  5034. var v2 map[uintptr]string
  5035. v2, changed = fastpathTV.DecMapUintptrStringV(*v, true, d)
  5036. if changed {
  5037. *v = v2
  5038. }
  5039. case map[uintptr]uint:
  5040. fastpathTV.DecMapUintptrUintV(v, false, d)
  5041. case *map[uintptr]uint:
  5042. var v2 map[uintptr]uint
  5043. v2, changed = fastpathTV.DecMapUintptrUintV(*v, true, d)
  5044. if changed {
  5045. *v = v2
  5046. }
  5047. case map[uintptr]uint8:
  5048. fastpathTV.DecMapUintptrUint8V(v, false, d)
  5049. case *map[uintptr]uint8:
  5050. var v2 map[uintptr]uint8
  5051. v2, changed = fastpathTV.DecMapUintptrUint8V(*v, true, d)
  5052. if changed {
  5053. *v = v2
  5054. }
  5055. case map[uintptr]uint64:
  5056. fastpathTV.DecMapUintptrUint64V(v, false, d)
  5057. case *map[uintptr]uint64:
  5058. var v2 map[uintptr]uint64
  5059. v2, changed = fastpathTV.DecMapUintptrUint64V(*v, true, d)
  5060. if changed {
  5061. *v = v2
  5062. }
  5063. case map[uintptr]uintptr:
  5064. fastpathTV.DecMapUintptrUintptrV(v, false, d)
  5065. case *map[uintptr]uintptr:
  5066. var v2 map[uintptr]uintptr
  5067. v2, changed = fastpathTV.DecMapUintptrUintptrV(*v, true, d)
  5068. if changed {
  5069. *v = v2
  5070. }
  5071. case map[uintptr]int:
  5072. fastpathTV.DecMapUintptrIntV(v, false, d)
  5073. case *map[uintptr]int:
  5074. var v2 map[uintptr]int
  5075. v2, changed = fastpathTV.DecMapUintptrIntV(*v, true, d)
  5076. if changed {
  5077. *v = v2
  5078. }
  5079. case map[uintptr]int64:
  5080. fastpathTV.DecMapUintptrInt64V(v, false, d)
  5081. case *map[uintptr]int64:
  5082. var v2 map[uintptr]int64
  5083. v2, changed = fastpathTV.DecMapUintptrInt64V(*v, true, d)
  5084. if changed {
  5085. *v = v2
  5086. }
  5087. case map[uintptr]float32:
  5088. fastpathTV.DecMapUintptrFloat32V(v, false, d)
  5089. case *map[uintptr]float32:
  5090. var v2 map[uintptr]float32
  5091. v2, changed = fastpathTV.DecMapUintptrFloat32V(*v, true, d)
  5092. if changed {
  5093. *v = v2
  5094. }
  5095. case map[uintptr]float64:
  5096. fastpathTV.DecMapUintptrFloat64V(v, false, d)
  5097. case *map[uintptr]float64:
  5098. var v2 map[uintptr]float64
  5099. v2, changed = fastpathTV.DecMapUintptrFloat64V(*v, true, d)
  5100. if changed {
  5101. *v = v2
  5102. }
  5103. case map[uintptr]bool:
  5104. fastpathTV.DecMapUintptrBoolV(v, false, d)
  5105. case *map[uintptr]bool:
  5106. var v2 map[uintptr]bool
  5107. v2, changed = fastpathTV.DecMapUintptrBoolV(*v, true, d)
  5108. if changed {
  5109. *v = v2
  5110. }
  5111. case map[int]interface{}:
  5112. fastpathTV.DecMapIntIntfV(v, false, d)
  5113. case *map[int]interface{}:
  5114. var v2 map[int]interface{}
  5115. v2, changed = fastpathTV.DecMapIntIntfV(*v, true, d)
  5116. if changed {
  5117. *v = v2
  5118. }
  5119. case map[int]string:
  5120. fastpathTV.DecMapIntStringV(v, false, d)
  5121. case *map[int]string:
  5122. var v2 map[int]string
  5123. v2, changed = fastpathTV.DecMapIntStringV(*v, true, d)
  5124. if changed {
  5125. *v = v2
  5126. }
  5127. case map[int]uint:
  5128. fastpathTV.DecMapIntUintV(v, false, d)
  5129. case *map[int]uint:
  5130. var v2 map[int]uint
  5131. v2, changed = fastpathTV.DecMapIntUintV(*v, true, d)
  5132. if changed {
  5133. *v = v2
  5134. }
  5135. case map[int]uint8:
  5136. fastpathTV.DecMapIntUint8V(v, false, d)
  5137. case *map[int]uint8:
  5138. var v2 map[int]uint8
  5139. v2, changed = fastpathTV.DecMapIntUint8V(*v, true, d)
  5140. if changed {
  5141. *v = v2
  5142. }
  5143. case map[int]uint64:
  5144. fastpathTV.DecMapIntUint64V(v, false, d)
  5145. case *map[int]uint64:
  5146. var v2 map[int]uint64
  5147. v2, changed = fastpathTV.DecMapIntUint64V(*v, true, d)
  5148. if changed {
  5149. *v = v2
  5150. }
  5151. case map[int]uintptr:
  5152. fastpathTV.DecMapIntUintptrV(v, false, d)
  5153. case *map[int]uintptr:
  5154. var v2 map[int]uintptr
  5155. v2, changed = fastpathTV.DecMapIntUintptrV(*v, true, d)
  5156. if changed {
  5157. *v = v2
  5158. }
  5159. case map[int]int:
  5160. fastpathTV.DecMapIntIntV(v, false, d)
  5161. case *map[int]int:
  5162. var v2 map[int]int
  5163. v2, changed = fastpathTV.DecMapIntIntV(*v, true, d)
  5164. if changed {
  5165. *v = v2
  5166. }
  5167. case map[int]int64:
  5168. fastpathTV.DecMapIntInt64V(v, false, d)
  5169. case *map[int]int64:
  5170. var v2 map[int]int64
  5171. v2, changed = fastpathTV.DecMapIntInt64V(*v, true, d)
  5172. if changed {
  5173. *v = v2
  5174. }
  5175. case map[int]float32:
  5176. fastpathTV.DecMapIntFloat32V(v, false, d)
  5177. case *map[int]float32:
  5178. var v2 map[int]float32
  5179. v2, changed = fastpathTV.DecMapIntFloat32V(*v, true, d)
  5180. if changed {
  5181. *v = v2
  5182. }
  5183. case map[int]float64:
  5184. fastpathTV.DecMapIntFloat64V(v, false, d)
  5185. case *map[int]float64:
  5186. var v2 map[int]float64
  5187. v2, changed = fastpathTV.DecMapIntFloat64V(*v, true, d)
  5188. if changed {
  5189. *v = v2
  5190. }
  5191. case map[int]bool:
  5192. fastpathTV.DecMapIntBoolV(v, false, d)
  5193. case *map[int]bool:
  5194. var v2 map[int]bool
  5195. v2, changed = fastpathTV.DecMapIntBoolV(*v, true, d)
  5196. if changed {
  5197. *v = v2
  5198. }
  5199. case map[int64]interface{}:
  5200. fastpathTV.DecMapInt64IntfV(v, false, d)
  5201. case *map[int64]interface{}:
  5202. var v2 map[int64]interface{}
  5203. v2, changed = fastpathTV.DecMapInt64IntfV(*v, true, d)
  5204. if changed {
  5205. *v = v2
  5206. }
  5207. case map[int64]string:
  5208. fastpathTV.DecMapInt64StringV(v, false, d)
  5209. case *map[int64]string:
  5210. var v2 map[int64]string
  5211. v2, changed = fastpathTV.DecMapInt64StringV(*v, true, d)
  5212. if changed {
  5213. *v = v2
  5214. }
  5215. case map[int64]uint:
  5216. fastpathTV.DecMapInt64UintV(v, false, d)
  5217. case *map[int64]uint:
  5218. var v2 map[int64]uint
  5219. v2, changed = fastpathTV.DecMapInt64UintV(*v, true, d)
  5220. if changed {
  5221. *v = v2
  5222. }
  5223. case map[int64]uint8:
  5224. fastpathTV.DecMapInt64Uint8V(v, false, d)
  5225. case *map[int64]uint8:
  5226. var v2 map[int64]uint8
  5227. v2, changed = fastpathTV.DecMapInt64Uint8V(*v, true, d)
  5228. if changed {
  5229. *v = v2
  5230. }
  5231. case map[int64]uint64:
  5232. fastpathTV.DecMapInt64Uint64V(v, false, d)
  5233. case *map[int64]uint64:
  5234. var v2 map[int64]uint64
  5235. v2, changed = fastpathTV.DecMapInt64Uint64V(*v, true, d)
  5236. if changed {
  5237. *v = v2
  5238. }
  5239. case map[int64]uintptr:
  5240. fastpathTV.DecMapInt64UintptrV(v, false, d)
  5241. case *map[int64]uintptr:
  5242. var v2 map[int64]uintptr
  5243. v2, changed = fastpathTV.DecMapInt64UintptrV(*v, true, d)
  5244. if changed {
  5245. *v = v2
  5246. }
  5247. case map[int64]int:
  5248. fastpathTV.DecMapInt64IntV(v, false, d)
  5249. case *map[int64]int:
  5250. var v2 map[int64]int
  5251. v2, changed = fastpathTV.DecMapInt64IntV(*v, true, d)
  5252. if changed {
  5253. *v = v2
  5254. }
  5255. case map[int64]int64:
  5256. fastpathTV.DecMapInt64Int64V(v, false, d)
  5257. case *map[int64]int64:
  5258. var v2 map[int64]int64
  5259. v2, changed = fastpathTV.DecMapInt64Int64V(*v, true, d)
  5260. if changed {
  5261. *v = v2
  5262. }
  5263. case map[int64]float32:
  5264. fastpathTV.DecMapInt64Float32V(v, false, d)
  5265. case *map[int64]float32:
  5266. var v2 map[int64]float32
  5267. v2, changed = fastpathTV.DecMapInt64Float32V(*v, true, d)
  5268. if changed {
  5269. *v = v2
  5270. }
  5271. case map[int64]float64:
  5272. fastpathTV.DecMapInt64Float64V(v, false, d)
  5273. case *map[int64]float64:
  5274. var v2 map[int64]float64
  5275. v2, changed = fastpathTV.DecMapInt64Float64V(*v, true, d)
  5276. if changed {
  5277. *v = v2
  5278. }
  5279. case map[int64]bool:
  5280. fastpathTV.DecMapInt64BoolV(v, false, d)
  5281. case *map[int64]bool:
  5282. var v2 map[int64]bool
  5283. v2, changed = fastpathTV.DecMapInt64BoolV(*v, true, d)
  5284. if changed {
  5285. *v = v2
  5286. }
  5287. default:
  5288. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  5289. return false
  5290. }
  5291. return true
  5292. }
  5293. func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
  5294. switch v := iv.(type) {
  5295. case *[]interface{}:
  5296. *v = nil
  5297. case *[]string:
  5298. *v = nil
  5299. case *[]float32:
  5300. *v = nil
  5301. case *[]float64:
  5302. *v = nil
  5303. case *[]uint:
  5304. *v = nil
  5305. case *[]uint8:
  5306. *v = nil
  5307. case *[]uint16:
  5308. *v = nil
  5309. case *[]uint32:
  5310. *v = nil
  5311. case *[]uint64:
  5312. *v = nil
  5313. case *[]uintptr:
  5314. *v = nil
  5315. case *[]int:
  5316. *v = nil
  5317. case *[]int8:
  5318. *v = nil
  5319. case *[]int16:
  5320. *v = nil
  5321. case *[]int32:
  5322. *v = nil
  5323. case *[]int64:
  5324. *v = nil
  5325. case *[]bool:
  5326. *v = nil
  5327. case *map[string]interface{}:
  5328. *v = nil
  5329. case *map[string]string:
  5330. *v = nil
  5331. case *map[string]uint:
  5332. *v = nil
  5333. case *map[string]uint8:
  5334. *v = nil
  5335. case *map[string]uint64:
  5336. *v = nil
  5337. case *map[string]uintptr:
  5338. *v = nil
  5339. case *map[string]int:
  5340. *v = nil
  5341. case *map[string]int64:
  5342. *v = nil
  5343. case *map[string]float32:
  5344. *v = nil
  5345. case *map[string]float64:
  5346. *v = nil
  5347. case *map[string]bool:
  5348. *v = nil
  5349. case *map[uint]interface{}:
  5350. *v = nil
  5351. case *map[uint]string:
  5352. *v = nil
  5353. case *map[uint]uint:
  5354. *v = nil
  5355. case *map[uint]uint8:
  5356. *v = nil
  5357. case *map[uint]uint64:
  5358. *v = nil
  5359. case *map[uint]uintptr:
  5360. *v = nil
  5361. case *map[uint]int:
  5362. *v = nil
  5363. case *map[uint]int64:
  5364. *v = nil
  5365. case *map[uint]float32:
  5366. *v = nil
  5367. case *map[uint]float64:
  5368. *v = nil
  5369. case *map[uint]bool:
  5370. *v = nil
  5371. case *map[uint8]interface{}:
  5372. *v = nil
  5373. case *map[uint8]string:
  5374. *v = nil
  5375. case *map[uint8]uint:
  5376. *v = nil
  5377. case *map[uint8]uint8:
  5378. *v = nil
  5379. case *map[uint8]uint64:
  5380. *v = nil
  5381. case *map[uint8]uintptr:
  5382. *v = nil
  5383. case *map[uint8]int:
  5384. *v = nil
  5385. case *map[uint8]int64:
  5386. *v = nil
  5387. case *map[uint8]float32:
  5388. *v = nil
  5389. case *map[uint8]float64:
  5390. *v = nil
  5391. case *map[uint8]bool:
  5392. *v = nil
  5393. case *map[uint64]interface{}:
  5394. *v = nil
  5395. case *map[uint64]string:
  5396. *v = nil
  5397. case *map[uint64]uint:
  5398. *v = nil
  5399. case *map[uint64]uint8:
  5400. *v = nil
  5401. case *map[uint64]uint64:
  5402. *v = nil
  5403. case *map[uint64]uintptr:
  5404. *v = nil
  5405. case *map[uint64]int:
  5406. *v = nil
  5407. case *map[uint64]int64:
  5408. *v = nil
  5409. case *map[uint64]float32:
  5410. *v = nil
  5411. case *map[uint64]float64:
  5412. *v = nil
  5413. case *map[uint64]bool:
  5414. *v = nil
  5415. case *map[uintptr]interface{}:
  5416. *v = nil
  5417. case *map[uintptr]string:
  5418. *v = nil
  5419. case *map[uintptr]uint:
  5420. *v = nil
  5421. case *map[uintptr]uint8:
  5422. *v = nil
  5423. case *map[uintptr]uint64:
  5424. *v = nil
  5425. case *map[uintptr]uintptr:
  5426. *v = nil
  5427. case *map[uintptr]int:
  5428. *v = nil
  5429. case *map[uintptr]int64:
  5430. *v = nil
  5431. case *map[uintptr]float32:
  5432. *v = nil
  5433. case *map[uintptr]float64:
  5434. *v = nil
  5435. case *map[uintptr]bool:
  5436. *v = nil
  5437. case *map[int]interface{}:
  5438. *v = nil
  5439. case *map[int]string:
  5440. *v = nil
  5441. case *map[int]uint:
  5442. *v = nil
  5443. case *map[int]uint8:
  5444. *v = nil
  5445. case *map[int]uint64:
  5446. *v = nil
  5447. case *map[int]uintptr:
  5448. *v = nil
  5449. case *map[int]int:
  5450. *v = nil
  5451. case *map[int]int64:
  5452. *v = nil
  5453. case *map[int]float32:
  5454. *v = nil
  5455. case *map[int]float64:
  5456. *v = nil
  5457. case *map[int]bool:
  5458. *v = nil
  5459. case *map[int64]interface{}:
  5460. *v = nil
  5461. case *map[int64]string:
  5462. *v = nil
  5463. case *map[int64]uint:
  5464. *v = nil
  5465. case *map[int64]uint8:
  5466. *v = nil
  5467. case *map[int64]uint64:
  5468. *v = nil
  5469. case *map[int64]uintptr:
  5470. *v = nil
  5471. case *map[int64]int:
  5472. *v = nil
  5473. case *map[int64]int64:
  5474. *v = nil
  5475. case *map[int64]float32:
  5476. *v = nil
  5477. case *map[int64]float64:
  5478. *v = nil
  5479. case *map[int64]bool:
  5480. *v = nil
  5481. default:
  5482. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  5483. return false
  5484. }
  5485. return true
  5486. }
  5487. // -- -- fast path functions
  5488. func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  5489. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5490. vp := rv2i(rv).(*[]interface{})
  5491. v, changed := fastpathTV.DecSliceIntfV(*vp, !array, d)
  5492. if changed {
  5493. *vp = v
  5494. }
  5495. } else {
  5496. v := rv2i(rv).([]interface{})
  5497. v2, changed := fastpathTV.DecSliceIntfV(v, !array, d)
  5498. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5499. copy(v, v2)
  5500. }
  5501. }
  5502. }
  5503. func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) {
  5504. v, changed := f.DecSliceIntfV(*vp, true, d)
  5505. if changed {
  5506. *vp = v
  5507. }
  5508. }
  5509. func (fastpathT) DecSliceIntfV(v []interface{}, canChange bool, d *Decoder) (_ []interface{}, changed bool) {
  5510. slh, containerLenS := d.decSliceHelperStart()
  5511. if containerLenS == 0 {
  5512. if canChange {
  5513. if v == nil {
  5514. v = []interface{}{}
  5515. } else if len(v) != 0 {
  5516. v = v[:0]
  5517. }
  5518. changed = true
  5519. }
  5520. slh.End()
  5521. return v, changed
  5522. }
  5523. d.depthIncr()
  5524. hasLen := containerLenS > 0
  5525. var xlen int
  5526. if hasLen && canChange {
  5527. if containerLenS > cap(v) {
  5528. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5529. if xlen <= cap(v) {
  5530. v = v[:uint(xlen)]
  5531. } else {
  5532. v = make([]interface{}, uint(xlen))
  5533. }
  5534. changed = true
  5535. } else if containerLenS != len(v) {
  5536. v = v[:containerLenS]
  5537. changed = true
  5538. }
  5539. }
  5540. var j int
  5541. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5542. if j == 0 && len(v) == 0 && canChange {
  5543. if hasLen {
  5544. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5545. } else {
  5546. xlen = 8
  5547. }
  5548. v = make([]interface{}, uint(xlen))
  5549. changed = true
  5550. }
  5551. // if indefinite, etc, then expand the slice if necessary
  5552. var decodeIntoBlank bool
  5553. if j >= len(v) {
  5554. if canChange {
  5555. v = append(v, nil)
  5556. changed = true
  5557. } else {
  5558. d.arrayCannotExpand(len(v), j+1)
  5559. decodeIntoBlank = true
  5560. }
  5561. }
  5562. slh.ElemContainerState(j)
  5563. if decodeIntoBlank {
  5564. d.swallow()
  5565. } else if d.d.TryDecodeAsNil() {
  5566. v[uint(j)] = nil
  5567. } else {
  5568. d.decode(&v[uint(j)])
  5569. }
  5570. }
  5571. if canChange {
  5572. if j < len(v) {
  5573. v = v[:uint(j)]
  5574. changed = true
  5575. } else if j == 0 && v == nil {
  5576. v = make([]interface{}, 0)
  5577. changed = true
  5578. }
  5579. }
  5580. slh.End()
  5581. d.depthDecr()
  5582. return v, changed
  5583. }
  5584. func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) {
  5585. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5586. vp := rv2i(rv).(*[]string)
  5587. v, changed := fastpathTV.DecSliceStringV(*vp, !array, d)
  5588. if changed {
  5589. *vp = v
  5590. }
  5591. } else {
  5592. v := rv2i(rv).([]string)
  5593. v2, changed := fastpathTV.DecSliceStringV(v, !array, d)
  5594. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5595. copy(v, v2)
  5596. }
  5597. }
  5598. }
  5599. func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) {
  5600. v, changed := f.DecSliceStringV(*vp, true, d)
  5601. if changed {
  5602. *vp = v
  5603. }
  5604. }
  5605. func (fastpathT) DecSliceStringV(v []string, canChange bool, d *Decoder) (_ []string, changed bool) {
  5606. slh, containerLenS := d.decSliceHelperStart()
  5607. if containerLenS == 0 {
  5608. if canChange {
  5609. if v == nil {
  5610. v = []string{}
  5611. } else if len(v) != 0 {
  5612. v = v[:0]
  5613. }
  5614. changed = true
  5615. }
  5616. slh.End()
  5617. return v, changed
  5618. }
  5619. d.depthIncr()
  5620. hasLen := containerLenS > 0
  5621. var xlen int
  5622. if hasLen && canChange {
  5623. if containerLenS > cap(v) {
  5624. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5625. if xlen <= cap(v) {
  5626. v = v[:uint(xlen)]
  5627. } else {
  5628. v = make([]string, uint(xlen))
  5629. }
  5630. changed = true
  5631. } else if containerLenS != len(v) {
  5632. v = v[:containerLenS]
  5633. changed = true
  5634. }
  5635. }
  5636. var j int
  5637. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5638. if j == 0 && len(v) == 0 && canChange {
  5639. if hasLen {
  5640. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5641. } else {
  5642. xlen = 8
  5643. }
  5644. v = make([]string, uint(xlen))
  5645. changed = true
  5646. }
  5647. // if indefinite, etc, then expand the slice if necessary
  5648. var decodeIntoBlank bool
  5649. if j >= len(v) {
  5650. if canChange {
  5651. v = append(v, "")
  5652. changed = true
  5653. } else {
  5654. d.arrayCannotExpand(len(v), j+1)
  5655. decodeIntoBlank = true
  5656. }
  5657. }
  5658. slh.ElemContainerState(j)
  5659. if decodeIntoBlank {
  5660. d.swallow()
  5661. } else if d.d.TryDecodeAsNil() {
  5662. v[uint(j)] = ""
  5663. } else {
  5664. v[uint(j)] = d.d.DecodeString()
  5665. }
  5666. }
  5667. if canChange {
  5668. if j < len(v) {
  5669. v = v[:uint(j)]
  5670. changed = true
  5671. } else if j == 0 && v == nil {
  5672. v = make([]string, 0)
  5673. changed = true
  5674. }
  5675. }
  5676. slh.End()
  5677. d.depthDecr()
  5678. return v, changed
  5679. }
  5680. func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  5681. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5682. vp := rv2i(rv).(*[]float32)
  5683. v, changed := fastpathTV.DecSliceFloat32V(*vp, !array, d)
  5684. if changed {
  5685. *vp = v
  5686. }
  5687. } else {
  5688. v := rv2i(rv).([]float32)
  5689. v2, changed := fastpathTV.DecSliceFloat32V(v, !array, d)
  5690. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5691. copy(v, v2)
  5692. }
  5693. }
  5694. }
  5695. func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) {
  5696. v, changed := f.DecSliceFloat32V(*vp, true, d)
  5697. if changed {
  5698. *vp = v
  5699. }
  5700. }
  5701. func (fastpathT) DecSliceFloat32V(v []float32, canChange bool, d *Decoder) (_ []float32, changed bool) {
  5702. slh, containerLenS := d.decSliceHelperStart()
  5703. if containerLenS == 0 {
  5704. if canChange {
  5705. if v == nil {
  5706. v = []float32{}
  5707. } else if len(v) != 0 {
  5708. v = v[:0]
  5709. }
  5710. changed = true
  5711. }
  5712. slh.End()
  5713. return v, changed
  5714. }
  5715. d.depthIncr()
  5716. hasLen := containerLenS > 0
  5717. var xlen int
  5718. if hasLen && canChange {
  5719. if containerLenS > cap(v) {
  5720. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5721. if xlen <= cap(v) {
  5722. v = v[:uint(xlen)]
  5723. } else {
  5724. v = make([]float32, uint(xlen))
  5725. }
  5726. changed = true
  5727. } else if containerLenS != len(v) {
  5728. v = v[:containerLenS]
  5729. changed = true
  5730. }
  5731. }
  5732. var j int
  5733. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5734. if j == 0 && len(v) == 0 && canChange {
  5735. if hasLen {
  5736. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5737. } else {
  5738. xlen = 8
  5739. }
  5740. v = make([]float32, uint(xlen))
  5741. changed = true
  5742. }
  5743. // if indefinite, etc, then expand the slice if necessary
  5744. var decodeIntoBlank bool
  5745. if j >= len(v) {
  5746. if canChange {
  5747. v = append(v, 0)
  5748. changed = true
  5749. } else {
  5750. d.arrayCannotExpand(len(v), j+1)
  5751. decodeIntoBlank = true
  5752. }
  5753. }
  5754. slh.ElemContainerState(j)
  5755. if decodeIntoBlank {
  5756. d.swallow()
  5757. } else if d.d.TryDecodeAsNil() {
  5758. v[uint(j)] = 0
  5759. } else {
  5760. v[uint(j)] = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  5761. }
  5762. }
  5763. if canChange {
  5764. if j < len(v) {
  5765. v = v[:uint(j)]
  5766. changed = true
  5767. } else if j == 0 && v == nil {
  5768. v = make([]float32, 0)
  5769. changed = true
  5770. }
  5771. }
  5772. slh.End()
  5773. d.depthDecr()
  5774. return v, changed
  5775. }
  5776. func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  5777. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5778. vp := rv2i(rv).(*[]float64)
  5779. v, changed := fastpathTV.DecSliceFloat64V(*vp, !array, d)
  5780. if changed {
  5781. *vp = v
  5782. }
  5783. } else {
  5784. v := rv2i(rv).([]float64)
  5785. v2, changed := fastpathTV.DecSliceFloat64V(v, !array, d)
  5786. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5787. copy(v, v2)
  5788. }
  5789. }
  5790. }
  5791. func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) {
  5792. v, changed := f.DecSliceFloat64V(*vp, true, d)
  5793. if changed {
  5794. *vp = v
  5795. }
  5796. }
  5797. func (fastpathT) DecSliceFloat64V(v []float64, canChange bool, d *Decoder) (_ []float64, changed bool) {
  5798. slh, containerLenS := d.decSliceHelperStart()
  5799. if containerLenS == 0 {
  5800. if canChange {
  5801. if v == nil {
  5802. v = []float64{}
  5803. } else if len(v) != 0 {
  5804. v = v[:0]
  5805. }
  5806. changed = true
  5807. }
  5808. slh.End()
  5809. return v, changed
  5810. }
  5811. d.depthIncr()
  5812. hasLen := containerLenS > 0
  5813. var xlen int
  5814. if hasLen && canChange {
  5815. if containerLenS > cap(v) {
  5816. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5817. if xlen <= cap(v) {
  5818. v = v[:uint(xlen)]
  5819. } else {
  5820. v = make([]float64, uint(xlen))
  5821. }
  5822. changed = true
  5823. } else if containerLenS != len(v) {
  5824. v = v[:containerLenS]
  5825. changed = true
  5826. }
  5827. }
  5828. var j int
  5829. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5830. if j == 0 && len(v) == 0 && canChange {
  5831. if hasLen {
  5832. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5833. } else {
  5834. xlen = 8
  5835. }
  5836. v = make([]float64, uint(xlen))
  5837. changed = true
  5838. }
  5839. // if indefinite, etc, then expand the slice if necessary
  5840. var decodeIntoBlank bool
  5841. if j >= len(v) {
  5842. if canChange {
  5843. v = append(v, 0)
  5844. changed = true
  5845. } else {
  5846. d.arrayCannotExpand(len(v), j+1)
  5847. decodeIntoBlank = true
  5848. }
  5849. }
  5850. slh.ElemContainerState(j)
  5851. if decodeIntoBlank {
  5852. d.swallow()
  5853. } else if d.d.TryDecodeAsNil() {
  5854. v[uint(j)] = 0
  5855. } else {
  5856. v[uint(j)] = d.d.DecodeFloat64()
  5857. }
  5858. }
  5859. if canChange {
  5860. if j < len(v) {
  5861. v = v[:uint(j)]
  5862. changed = true
  5863. } else if j == 0 && v == nil {
  5864. v = make([]float64, 0)
  5865. changed = true
  5866. }
  5867. }
  5868. slh.End()
  5869. d.depthDecr()
  5870. return v, changed
  5871. }
  5872. func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) {
  5873. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5874. vp := rv2i(rv).(*[]uint)
  5875. v, changed := fastpathTV.DecSliceUintV(*vp, !array, d)
  5876. if changed {
  5877. *vp = v
  5878. }
  5879. } else {
  5880. v := rv2i(rv).([]uint)
  5881. v2, changed := fastpathTV.DecSliceUintV(v, !array, d)
  5882. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5883. copy(v, v2)
  5884. }
  5885. }
  5886. }
  5887. func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) {
  5888. v, changed := f.DecSliceUintV(*vp, true, d)
  5889. if changed {
  5890. *vp = v
  5891. }
  5892. }
  5893. func (fastpathT) DecSliceUintV(v []uint, canChange bool, d *Decoder) (_ []uint, changed bool) {
  5894. slh, containerLenS := d.decSliceHelperStart()
  5895. if containerLenS == 0 {
  5896. if canChange {
  5897. if v == nil {
  5898. v = []uint{}
  5899. } else if len(v) != 0 {
  5900. v = v[:0]
  5901. }
  5902. changed = true
  5903. }
  5904. slh.End()
  5905. return v, changed
  5906. }
  5907. d.depthIncr()
  5908. hasLen := containerLenS > 0
  5909. var xlen int
  5910. if hasLen && canChange {
  5911. if containerLenS > cap(v) {
  5912. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5913. if xlen <= cap(v) {
  5914. v = v[:uint(xlen)]
  5915. } else {
  5916. v = make([]uint, uint(xlen))
  5917. }
  5918. changed = true
  5919. } else if containerLenS != len(v) {
  5920. v = v[:containerLenS]
  5921. changed = true
  5922. }
  5923. }
  5924. var j int
  5925. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5926. if j == 0 && len(v) == 0 && canChange {
  5927. if hasLen {
  5928. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5929. } else {
  5930. xlen = 8
  5931. }
  5932. v = make([]uint, uint(xlen))
  5933. changed = true
  5934. }
  5935. // if indefinite, etc, then expand the slice if necessary
  5936. var decodeIntoBlank bool
  5937. if j >= len(v) {
  5938. if canChange {
  5939. v = append(v, 0)
  5940. changed = true
  5941. } else {
  5942. d.arrayCannotExpand(len(v), j+1)
  5943. decodeIntoBlank = true
  5944. }
  5945. }
  5946. slh.ElemContainerState(j)
  5947. if decodeIntoBlank {
  5948. d.swallow()
  5949. } else if d.d.TryDecodeAsNil() {
  5950. v[uint(j)] = 0
  5951. } else {
  5952. v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  5953. }
  5954. }
  5955. if canChange {
  5956. if j < len(v) {
  5957. v = v[:uint(j)]
  5958. changed = true
  5959. } else if j == 0 && v == nil {
  5960. v = make([]uint, 0)
  5961. changed = true
  5962. }
  5963. }
  5964. slh.End()
  5965. d.depthDecr()
  5966. return v, changed
  5967. }
  5968. func (d *Decoder) fastpathDecSliceUint8R(f *codecFnInfo, rv reflect.Value) {
  5969. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5970. vp := rv2i(rv).(*[]uint8)
  5971. v, changed := fastpathTV.DecSliceUint8V(*vp, !array, d)
  5972. if changed {
  5973. *vp = v
  5974. }
  5975. } else {
  5976. v := rv2i(rv).([]uint8)
  5977. v2, changed := fastpathTV.DecSliceUint8V(v, !array, d)
  5978. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5979. copy(v, v2)
  5980. }
  5981. }
  5982. }
  5983. func (f fastpathT) DecSliceUint8X(vp *[]uint8, d *Decoder) {
  5984. v, changed := f.DecSliceUint8V(*vp, true, d)
  5985. if changed {
  5986. *vp = v
  5987. }
  5988. }
  5989. func (fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) {
  5990. slh, containerLenS := d.decSliceHelperStart()
  5991. if containerLenS == 0 {
  5992. if canChange {
  5993. if v == nil {
  5994. v = []uint8{}
  5995. } else if len(v) != 0 {
  5996. v = v[:0]
  5997. }
  5998. changed = true
  5999. }
  6000. slh.End()
  6001. return v, changed
  6002. }
  6003. d.depthIncr()
  6004. hasLen := containerLenS > 0
  6005. var xlen int
  6006. if hasLen && canChange {
  6007. if containerLenS > cap(v) {
  6008. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6009. if xlen <= cap(v) {
  6010. v = v[:uint(xlen)]
  6011. } else {
  6012. v = make([]uint8, uint(xlen))
  6013. }
  6014. changed = true
  6015. } else if containerLenS != len(v) {
  6016. v = v[:containerLenS]
  6017. changed = true
  6018. }
  6019. }
  6020. var j int
  6021. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6022. if j == 0 && len(v) == 0 && canChange {
  6023. if hasLen {
  6024. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6025. } else {
  6026. xlen = 8
  6027. }
  6028. v = make([]uint8, uint(xlen))
  6029. changed = true
  6030. }
  6031. // if indefinite, etc, then expand the slice if necessary
  6032. var decodeIntoBlank bool
  6033. if j >= len(v) {
  6034. if canChange {
  6035. v = append(v, 0)
  6036. changed = true
  6037. } else {
  6038. d.arrayCannotExpand(len(v), j+1)
  6039. decodeIntoBlank = true
  6040. }
  6041. }
  6042. slh.ElemContainerState(j)
  6043. if decodeIntoBlank {
  6044. d.swallow()
  6045. } else if d.d.TryDecodeAsNil() {
  6046. v[uint(j)] = 0
  6047. } else {
  6048. v[uint(j)] = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6049. }
  6050. }
  6051. if canChange {
  6052. if j < len(v) {
  6053. v = v[:uint(j)]
  6054. changed = true
  6055. } else if j == 0 && v == nil {
  6056. v = make([]uint8, 0)
  6057. changed = true
  6058. }
  6059. }
  6060. slh.End()
  6061. d.depthDecr()
  6062. return v, changed
  6063. }
  6064. func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  6065. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6066. vp := rv2i(rv).(*[]uint16)
  6067. v, changed := fastpathTV.DecSliceUint16V(*vp, !array, d)
  6068. if changed {
  6069. *vp = v
  6070. }
  6071. } else {
  6072. v := rv2i(rv).([]uint16)
  6073. v2, changed := fastpathTV.DecSliceUint16V(v, !array, d)
  6074. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6075. copy(v, v2)
  6076. }
  6077. }
  6078. }
  6079. func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) {
  6080. v, changed := f.DecSliceUint16V(*vp, true, d)
  6081. if changed {
  6082. *vp = v
  6083. }
  6084. }
  6085. func (fastpathT) DecSliceUint16V(v []uint16, canChange bool, d *Decoder) (_ []uint16, changed bool) {
  6086. slh, containerLenS := d.decSliceHelperStart()
  6087. if containerLenS == 0 {
  6088. if canChange {
  6089. if v == nil {
  6090. v = []uint16{}
  6091. } else if len(v) != 0 {
  6092. v = v[:0]
  6093. }
  6094. changed = true
  6095. }
  6096. slh.End()
  6097. return v, changed
  6098. }
  6099. d.depthIncr()
  6100. hasLen := containerLenS > 0
  6101. var xlen int
  6102. if hasLen && canChange {
  6103. if containerLenS > cap(v) {
  6104. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6105. if xlen <= cap(v) {
  6106. v = v[:uint(xlen)]
  6107. } else {
  6108. v = make([]uint16, uint(xlen))
  6109. }
  6110. changed = true
  6111. } else if containerLenS != len(v) {
  6112. v = v[:containerLenS]
  6113. changed = true
  6114. }
  6115. }
  6116. var j int
  6117. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6118. if j == 0 && len(v) == 0 && canChange {
  6119. if hasLen {
  6120. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6121. } else {
  6122. xlen = 8
  6123. }
  6124. v = make([]uint16, uint(xlen))
  6125. changed = true
  6126. }
  6127. // if indefinite, etc, then expand the slice if necessary
  6128. var decodeIntoBlank bool
  6129. if j >= len(v) {
  6130. if canChange {
  6131. v = append(v, 0)
  6132. changed = true
  6133. } else {
  6134. d.arrayCannotExpand(len(v), j+1)
  6135. decodeIntoBlank = true
  6136. }
  6137. }
  6138. slh.ElemContainerState(j)
  6139. if decodeIntoBlank {
  6140. d.swallow()
  6141. } else if d.d.TryDecodeAsNil() {
  6142. v[uint(j)] = 0
  6143. } else {
  6144. v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
  6145. }
  6146. }
  6147. if canChange {
  6148. if j < len(v) {
  6149. v = v[:uint(j)]
  6150. changed = true
  6151. } else if j == 0 && v == nil {
  6152. v = make([]uint16, 0)
  6153. changed = true
  6154. }
  6155. }
  6156. slh.End()
  6157. d.depthDecr()
  6158. return v, changed
  6159. }
  6160. func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  6161. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6162. vp := rv2i(rv).(*[]uint32)
  6163. v, changed := fastpathTV.DecSliceUint32V(*vp, !array, d)
  6164. if changed {
  6165. *vp = v
  6166. }
  6167. } else {
  6168. v := rv2i(rv).([]uint32)
  6169. v2, changed := fastpathTV.DecSliceUint32V(v, !array, d)
  6170. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6171. copy(v, v2)
  6172. }
  6173. }
  6174. }
  6175. func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) {
  6176. v, changed := f.DecSliceUint32V(*vp, true, d)
  6177. if changed {
  6178. *vp = v
  6179. }
  6180. }
  6181. func (fastpathT) DecSliceUint32V(v []uint32, canChange bool, d *Decoder) (_ []uint32, changed bool) {
  6182. slh, containerLenS := d.decSliceHelperStart()
  6183. if containerLenS == 0 {
  6184. if canChange {
  6185. if v == nil {
  6186. v = []uint32{}
  6187. } else if len(v) != 0 {
  6188. v = v[:0]
  6189. }
  6190. changed = true
  6191. }
  6192. slh.End()
  6193. return v, changed
  6194. }
  6195. d.depthIncr()
  6196. hasLen := containerLenS > 0
  6197. var xlen int
  6198. if hasLen && canChange {
  6199. if containerLenS > cap(v) {
  6200. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6201. if xlen <= cap(v) {
  6202. v = v[:uint(xlen)]
  6203. } else {
  6204. v = make([]uint32, uint(xlen))
  6205. }
  6206. changed = true
  6207. } else if containerLenS != len(v) {
  6208. v = v[:containerLenS]
  6209. changed = true
  6210. }
  6211. }
  6212. var j int
  6213. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6214. if j == 0 && len(v) == 0 && canChange {
  6215. if hasLen {
  6216. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6217. } else {
  6218. xlen = 8
  6219. }
  6220. v = make([]uint32, uint(xlen))
  6221. changed = true
  6222. }
  6223. // if indefinite, etc, then expand the slice if necessary
  6224. var decodeIntoBlank bool
  6225. if j >= len(v) {
  6226. if canChange {
  6227. v = append(v, 0)
  6228. changed = true
  6229. } else {
  6230. d.arrayCannotExpand(len(v), j+1)
  6231. decodeIntoBlank = true
  6232. }
  6233. }
  6234. slh.ElemContainerState(j)
  6235. if decodeIntoBlank {
  6236. d.swallow()
  6237. } else if d.d.TryDecodeAsNil() {
  6238. v[uint(j)] = 0
  6239. } else {
  6240. v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
  6241. }
  6242. }
  6243. if canChange {
  6244. if j < len(v) {
  6245. v = v[:uint(j)]
  6246. changed = true
  6247. } else if j == 0 && v == nil {
  6248. v = make([]uint32, 0)
  6249. changed = true
  6250. }
  6251. }
  6252. slh.End()
  6253. d.depthDecr()
  6254. return v, changed
  6255. }
  6256. func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  6257. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6258. vp := rv2i(rv).(*[]uint64)
  6259. v, changed := fastpathTV.DecSliceUint64V(*vp, !array, d)
  6260. if changed {
  6261. *vp = v
  6262. }
  6263. } else {
  6264. v := rv2i(rv).([]uint64)
  6265. v2, changed := fastpathTV.DecSliceUint64V(v, !array, d)
  6266. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6267. copy(v, v2)
  6268. }
  6269. }
  6270. }
  6271. func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) {
  6272. v, changed := f.DecSliceUint64V(*vp, true, d)
  6273. if changed {
  6274. *vp = v
  6275. }
  6276. }
  6277. func (fastpathT) DecSliceUint64V(v []uint64, canChange bool, d *Decoder) (_ []uint64, changed bool) {
  6278. slh, containerLenS := d.decSliceHelperStart()
  6279. if containerLenS == 0 {
  6280. if canChange {
  6281. if v == nil {
  6282. v = []uint64{}
  6283. } else if len(v) != 0 {
  6284. v = v[:0]
  6285. }
  6286. changed = true
  6287. }
  6288. slh.End()
  6289. return v, changed
  6290. }
  6291. d.depthIncr()
  6292. hasLen := containerLenS > 0
  6293. var xlen int
  6294. if hasLen && canChange {
  6295. if containerLenS > cap(v) {
  6296. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6297. if xlen <= cap(v) {
  6298. v = v[:uint(xlen)]
  6299. } else {
  6300. v = make([]uint64, uint(xlen))
  6301. }
  6302. changed = true
  6303. } else if containerLenS != len(v) {
  6304. v = v[:containerLenS]
  6305. changed = true
  6306. }
  6307. }
  6308. var j int
  6309. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6310. if j == 0 && len(v) == 0 && canChange {
  6311. if hasLen {
  6312. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6313. } else {
  6314. xlen = 8
  6315. }
  6316. v = make([]uint64, uint(xlen))
  6317. changed = true
  6318. }
  6319. // if indefinite, etc, then expand the slice if necessary
  6320. var decodeIntoBlank bool
  6321. if j >= len(v) {
  6322. if canChange {
  6323. v = append(v, 0)
  6324. changed = true
  6325. } else {
  6326. d.arrayCannotExpand(len(v), j+1)
  6327. decodeIntoBlank = true
  6328. }
  6329. }
  6330. slh.ElemContainerState(j)
  6331. if decodeIntoBlank {
  6332. d.swallow()
  6333. } else if d.d.TryDecodeAsNil() {
  6334. v[uint(j)] = 0
  6335. } else {
  6336. v[uint(j)] = d.d.DecodeUint64()
  6337. }
  6338. }
  6339. if canChange {
  6340. if j < len(v) {
  6341. v = v[:uint(j)]
  6342. changed = true
  6343. } else if j == 0 && v == nil {
  6344. v = make([]uint64, 0)
  6345. changed = true
  6346. }
  6347. }
  6348. slh.End()
  6349. d.depthDecr()
  6350. return v, changed
  6351. }
  6352. func (d *Decoder) fastpathDecSliceUintptrR(f *codecFnInfo, rv reflect.Value) {
  6353. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6354. vp := rv2i(rv).(*[]uintptr)
  6355. v, changed := fastpathTV.DecSliceUintptrV(*vp, !array, d)
  6356. if changed {
  6357. *vp = v
  6358. }
  6359. } else {
  6360. v := rv2i(rv).([]uintptr)
  6361. v2, changed := fastpathTV.DecSliceUintptrV(v, !array, d)
  6362. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6363. copy(v, v2)
  6364. }
  6365. }
  6366. }
  6367. func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, d *Decoder) {
  6368. v, changed := f.DecSliceUintptrV(*vp, true, d)
  6369. if changed {
  6370. *vp = v
  6371. }
  6372. }
  6373. func (fastpathT) DecSliceUintptrV(v []uintptr, canChange bool, d *Decoder) (_ []uintptr, changed bool) {
  6374. slh, containerLenS := d.decSliceHelperStart()
  6375. if containerLenS == 0 {
  6376. if canChange {
  6377. if v == nil {
  6378. v = []uintptr{}
  6379. } else if len(v) != 0 {
  6380. v = v[:0]
  6381. }
  6382. changed = true
  6383. }
  6384. slh.End()
  6385. return v, changed
  6386. }
  6387. d.depthIncr()
  6388. hasLen := containerLenS > 0
  6389. var xlen int
  6390. if hasLen && canChange {
  6391. if containerLenS > cap(v) {
  6392. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6393. if xlen <= cap(v) {
  6394. v = v[:uint(xlen)]
  6395. } else {
  6396. v = make([]uintptr, uint(xlen))
  6397. }
  6398. changed = true
  6399. } else if containerLenS != len(v) {
  6400. v = v[:containerLenS]
  6401. changed = true
  6402. }
  6403. }
  6404. var j int
  6405. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6406. if j == 0 && len(v) == 0 && canChange {
  6407. if hasLen {
  6408. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6409. } else {
  6410. xlen = 8
  6411. }
  6412. v = make([]uintptr, uint(xlen))
  6413. changed = true
  6414. }
  6415. // if indefinite, etc, then expand the slice if necessary
  6416. var decodeIntoBlank bool
  6417. if j >= len(v) {
  6418. if canChange {
  6419. v = append(v, 0)
  6420. changed = true
  6421. } else {
  6422. d.arrayCannotExpand(len(v), j+1)
  6423. decodeIntoBlank = true
  6424. }
  6425. }
  6426. slh.ElemContainerState(j)
  6427. if decodeIntoBlank {
  6428. d.swallow()
  6429. } else if d.d.TryDecodeAsNil() {
  6430. v[uint(j)] = 0
  6431. } else {
  6432. v[uint(j)] = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6433. }
  6434. }
  6435. if canChange {
  6436. if j < len(v) {
  6437. v = v[:uint(j)]
  6438. changed = true
  6439. } else if j == 0 && v == nil {
  6440. v = make([]uintptr, 0)
  6441. changed = true
  6442. }
  6443. }
  6444. slh.End()
  6445. d.depthDecr()
  6446. return v, changed
  6447. }
  6448. func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) {
  6449. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6450. vp := rv2i(rv).(*[]int)
  6451. v, changed := fastpathTV.DecSliceIntV(*vp, !array, d)
  6452. if changed {
  6453. *vp = v
  6454. }
  6455. } else {
  6456. v := rv2i(rv).([]int)
  6457. v2, changed := fastpathTV.DecSliceIntV(v, !array, d)
  6458. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6459. copy(v, v2)
  6460. }
  6461. }
  6462. }
  6463. func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) {
  6464. v, changed := f.DecSliceIntV(*vp, true, d)
  6465. if changed {
  6466. *vp = v
  6467. }
  6468. }
  6469. func (fastpathT) DecSliceIntV(v []int, canChange bool, d *Decoder) (_ []int, changed bool) {
  6470. slh, containerLenS := d.decSliceHelperStart()
  6471. if containerLenS == 0 {
  6472. if canChange {
  6473. if v == nil {
  6474. v = []int{}
  6475. } else if len(v) != 0 {
  6476. v = v[:0]
  6477. }
  6478. changed = true
  6479. }
  6480. slh.End()
  6481. return v, changed
  6482. }
  6483. d.depthIncr()
  6484. hasLen := containerLenS > 0
  6485. var xlen int
  6486. if hasLen && canChange {
  6487. if containerLenS > cap(v) {
  6488. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6489. if xlen <= cap(v) {
  6490. v = v[:uint(xlen)]
  6491. } else {
  6492. v = make([]int, uint(xlen))
  6493. }
  6494. changed = true
  6495. } else if containerLenS != len(v) {
  6496. v = v[:containerLenS]
  6497. changed = true
  6498. }
  6499. }
  6500. var j int
  6501. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6502. if j == 0 && len(v) == 0 && canChange {
  6503. if hasLen {
  6504. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6505. } else {
  6506. xlen = 8
  6507. }
  6508. v = make([]int, uint(xlen))
  6509. changed = true
  6510. }
  6511. // if indefinite, etc, then expand the slice if necessary
  6512. var decodeIntoBlank bool
  6513. if j >= len(v) {
  6514. if canChange {
  6515. v = append(v, 0)
  6516. changed = true
  6517. } else {
  6518. d.arrayCannotExpand(len(v), j+1)
  6519. decodeIntoBlank = true
  6520. }
  6521. }
  6522. slh.ElemContainerState(j)
  6523. if decodeIntoBlank {
  6524. d.swallow()
  6525. } else if d.d.TryDecodeAsNil() {
  6526. v[uint(j)] = 0
  6527. } else {
  6528. v[uint(j)] = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  6529. }
  6530. }
  6531. if canChange {
  6532. if j < len(v) {
  6533. v = v[:uint(j)]
  6534. changed = true
  6535. } else if j == 0 && v == nil {
  6536. v = make([]int, 0)
  6537. changed = true
  6538. }
  6539. }
  6540. slh.End()
  6541. d.depthDecr()
  6542. return v, changed
  6543. }
  6544. func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  6545. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6546. vp := rv2i(rv).(*[]int8)
  6547. v, changed := fastpathTV.DecSliceInt8V(*vp, !array, d)
  6548. if changed {
  6549. *vp = v
  6550. }
  6551. } else {
  6552. v := rv2i(rv).([]int8)
  6553. v2, changed := fastpathTV.DecSliceInt8V(v, !array, d)
  6554. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6555. copy(v, v2)
  6556. }
  6557. }
  6558. }
  6559. func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) {
  6560. v, changed := f.DecSliceInt8V(*vp, true, d)
  6561. if changed {
  6562. *vp = v
  6563. }
  6564. }
  6565. func (fastpathT) DecSliceInt8V(v []int8, canChange bool, d *Decoder) (_ []int8, changed bool) {
  6566. slh, containerLenS := d.decSliceHelperStart()
  6567. if containerLenS == 0 {
  6568. if canChange {
  6569. if v == nil {
  6570. v = []int8{}
  6571. } else if len(v) != 0 {
  6572. v = v[:0]
  6573. }
  6574. changed = true
  6575. }
  6576. slh.End()
  6577. return v, changed
  6578. }
  6579. d.depthIncr()
  6580. hasLen := containerLenS > 0
  6581. var xlen int
  6582. if hasLen && canChange {
  6583. if containerLenS > cap(v) {
  6584. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6585. if xlen <= cap(v) {
  6586. v = v[:uint(xlen)]
  6587. } else {
  6588. v = make([]int8, uint(xlen))
  6589. }
  6590. changed = true
  6591. } else if containerLenS != len(v) {
  6592. v = v[:containerLenS]
  6593. changed = true
  6594. }
  6595. }
  6596. var j int
  6597. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6598. if j == 0 && len(v) == 0 && canChange {
  6599. if hasLen {
  6600. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6601. } else {
  6602. xlen = 8
  6603. }
  6604. v = make([]int8, uint(xlen))
  6605. changed = true
  6606. }
  6607. // if indefinite, etc, then expand the slice if necessary
  6608. var decodeIntoBlank bool
  6609. if j >= len(v) {
  6610. if canChange {
  6611. v = append(v, 0)
  6612. changed = true
  6613. } else {
  6614. d.arrayCannotExpand(len(v), j+1)
  6615. decodeIntoBlank = true
  6616. }
  6617. }
  6618. slh.ElemContainerState(j)
  6619. if decodeIntoBlank {
  6620. d.swallow()
  6621. } else if d.d.TryDecodeAsNil() {
  6622. v[uint(j)] = 0
  6623. } else {
  6624. v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
  6625. }
  6626. }
  6627. if canChange {
  6628. if j < len(v) {
  6629. v = v[:uint(j)]
  6630. changed = true
  6631. } else if j == 0 && v == nil {
  6632. v = make([]int8, 0)
  6633. changed = true
  6634. }
  6635. }
  6636. slh.End()
  6637. d.depthDecr()
  6638. return v, changed
  6639. }
  6640. func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  6641. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6642. vp := rv2i(rv).(*[]int16)
  6643. v, changed := fastpathTV.DecSliceInt16V(*vp, !array, d)
  6644. if changed {
  6645. *vp = v
  6646. }
  6647. } else {
  6648. v := rv2i(rv).([]int16)
  6649. v2, changed := fastpathTV.DecSliceInt16V(v, !array, d)
  6650. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6651. copy(v, v2)
  6652. }
  6653. }
  6654. }
  6655. func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) {
  6656. v, changed := f.DecSliceInt16V(*vp, true, d)
  6657. if changed {
  6658. *vp = v
  6659. }
  6660. }
  6661. func (fastpathT) DecSliceInt16V(v []int16, canChange bool, d *Decoder) (_ []int16, changed bool) {
  6662. slh, containerLenS := d.decSliceHelperStart()
  6663. if containerLenS == 0 {
  6664. if canChange {
  6665. if v == nil {
  6666. v = []int16{}
  6667. } else if len(v) != 0 {
  6668. v = v[:0]
  6669. }
  6670. changed = true
  6671. }
  6672. slh.End()
  6673. return v, changed
  6674. }
  6675. d.depthIncr()
  6676. hasLen := containerLenS > 0
  6677. var xlen int
  6678. if hasLen && canChange {
  6679. if containerLenS > cap(v) {
  6680. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6681. if xlen <= cap(v) {
  6682. v = v[:uint(xlen)]
  6683. } else {
  6684. v = make([]int16, uint(xlen))
  6685. }
  6686. changed = true
  6687. } else if containerLenS != len(v) {
  6688. v = v[:containerLenS]
  6689. changed = true
  6690. }
  6691. }
  6692. var j int
  6693. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6694. if j == 0 && len(v) == 0 && canChange {
  6695. if hasLen {
  6696. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6697. } else {
  6698. xlen = 8
  6699. }
  6700. v = make([]int16, uint(xlen))
  6701. changed = true
  6702. }
  6703. // if indefinite, etc, then expand the slice if necessary
  6704. var decodeIntoBlank bool
  6705. if j >= len(v) {
  6706. if canChange {
  6707. v = append(v, 0)
  6708. changed = true
  6709. } else {
  6710. d.arrayCannotExpand(len(v), j+1)
  6711. decodeIntoBlank = true
  6712. }
  6713. }
  6714. slh.ElemContainerState(j)
  6715. if decodeIntoBlank {
  6716. d.swallow()
  6717. } else if d.d.TryDecodeAsNil() {
  6718. v[uint(j)] = 0
  6719. } else {
  6720. v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
  6721. }
  6722. }
  6723. if canChange {
  6724. if j < len(v) {
  6725. v = v[:uint(j)]
  6726. changed = true
  6727. } else if j == 0 && v == nil {
  6728. v = make([]int16, 0)
  6729. changed = true
  6730. }
  6731. }
  6732. slh.End()
  6733. d.depthDecr()
  6734. return v, changed
  6735. }
  6736. func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  6737. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6738. vp := rv2i(rv).(*[]int32)
  6739. v, changed := fastpathTV.DecSliceInt32V(*vp, !array, d)
  6740. if changed {
  6741. *vp = v
  6742. }
  6743. } else {
  6744. v := rv2i(rv).([]int32)
  6745. v2, changed := fastpathTV.DecSliceInt32V(v, !array, d)
  6746. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6747. copy(v, v2)
  6748. }
  6749. }
  6750. }
  6751. func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) {
  6752. v, changed := f.DecSliceInt32V(*vp, true, d)
  6753. if changed {
  6754. *vp = v
  6755. }
  6756. }
  6757. func (fastpathT) DecSliceInt32V(v []int32, canChange bool, d *Decoder) (_ []int32, changed bool) {
  6758. slh, containerLenS := d.decSliceHelperStart()
  6759. if containerLenS == 0 {
  6760. if canChange {
  6761. if v == nil {
  6762. v = []int32{}
  6763. } else if len(v) != 0 {
  6764. v = v[:0]
  6765. }
  6766. changed = true
  6767. }
  6768. slh.End()
  6769. return v, changed
  6770. }
  6771. d.depthIncr()
  6772. hasLen := containerLenS > 0
  6773. var xlen int
  6774. if hasLen && canChange {
  6775. if containerLenS > cap(v) {
  6776. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6777. if xlen <= cap(v) {
  6778. v = v[:uint(xlen)]
  6779. } else {
  6780. v = make([]int32, uint(xlen))
  6781. }
  6782. changed = true
  6783. } else if containerLenS != len(v) {
  6784. v = v[:containerLenS]
  6785. changed = true
  6786. }
  6787. }
  6788. var j int
  6789. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6790. if j == 0 && len(v) == 0 && canChange {
  6791. if hasLen {
  6792. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6793. } else {
  6794. xlen = 8
  6795. }
  6796. v = make([]int32, uint(xlen))
  6797. changed = true
  6798. }
  6799. // if indefinite, etc, then expand the slice if necessary
  6800. var decodeIntoBlank bool
  6801. if j >= len(v) {
  6802. if canChange {
  6803. v = append(v, 0)
  6804. changed = true
  6805. } else {
  6806. d.arrayCannotExpand(len(v), j+1)
  6807. decodeIntoBlank = true
  6808. }
  6809. }
  6810. slh.ElemContainerState(j)
  6811. if decodeIntoBlank {
  6812. d.swallow()
  6813. } else if d.d.TryDecodeAsNil() {
  6814. v[uint(j)] = 0
  6815. } else {
  6816. v[uint(j)] = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
  6817. }
  6818. }
  6819. if canChange {
  6820. if j < len(v) {
  6821. v = v[:uint(j)]
  6822. changed = true
  6823. } else if j == 0 && v == nil {
  6824. v = make([]int32, 0)
  6825. changed = true
  6826. }
  6827. }
  6828. slh.End()
  6829. d.depthDecr()
  6830. return v, changed
  6831. }
  6832. func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  6833. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6834. vp := rv2i(rv).(*[]int64)
  6835. v, changed := fastpathTV.DecSliceInt64V(*vp, !array, d)
  6836. if changed {
  6837. *vp = v
  6838. }
  6839. } else {
  6840. v := rv2i(rv).([]int64)
  6841. v2, changed := fastpathTV.DecSliceInt64V(v, !array, d)
  6842. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6843. copy(v, v2)
  6844. }
  6845. }
  6846. }
  6847. func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) {
  6848. v, changed := f.DecSliceInt64V(*vp, true, d)
  6849. if changed {
  6850. *vp = v
  6851. }
  6852. }
  6853. func (fastpathT) DecSliceInt64V(v []int64, canChange bool, d *Decoder) (_ []int64, changed bool) {
  6854. slh, containerLenS := d.decSliceHelperStart()
  6855. if containerLenS == 0 {
  6856. if canChange {
  6857. if v == nil {
  6858. v = []int64{}
  6859. } else if len(v) != 0 {
  6860. v = v[:0]
  6861. }
  6862. changed = true
  6863. }
  6864. slh.End()
  6865. return v, changed
  6866. }
  6867. d.depthIncr()
  6868. hasLen := containerLenS > 0
  6869. var xlen int
  6870. if hasLen && canChange {
  6871. if containerLenS > cap(v) {
  6872. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6873. if xlen <= cap(v) {
  6874. v = v[:uint(xlen)]
  6875. } else {
  6876. v = make([]int64, uint(xlen))
  6877. }
  6878. changed = true
  6879. } else if containerLenS != len(v) {
  6880. v = v[:containerLenS]
  6881. changed = true
  6882. }
  6883. }
  6884. var j int
  6885. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6886. if j == 0 && len(v) == 0 && canChange {
  6887. if hasLen {
  6888. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6889. } else {
  6890. xlen = 8
  6891. }
  6892. v = make([]int64, uint(xlen))
  6893. changed = true
  6894. }
  6895. // if indefinite, etc, then expand the slice if necessary
  6896. var decodeIntoBlank bool
  6897. if j >= len(v) {
  6898. if canChange {
  6899. v = append(v, 0)
  6900. changed = true
  6901. } else {
  6902. d.arrayCannotExpand(len(v), j+1)
  6903. decodeIntoBlank = true
  6904. }
  6905. }
  6906. slh.ElemContainerState(j)
  6907. if decodeIntoBlank {
  6908. d.swallow()
  6909. } else if d.d.TryDecodeAsNil() {
  6910. v[uint(j)] = 0
  6911. } else {
  6912. v[uint(j)] = d.d.DecodeInt64()
  6913. }
  6914. }
  6915. if canChange {
  6916. if j < len(v) {
  6917. v = v[:uint(j)]
  6918. changed = true
  6919. } else if j == 0 && v == nil {
  6920. v = make([]int64, 0)
  6921. changed = true
  6922. }
  6923. }
  6924. slh.End()
  6925. d.depthDecr()
  6926. return v, changed
  6927. }
  6928. func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  6929. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6930. vp := rv2i(rv).(*[]bool)
  6931. v, changed := fastpathTV.DecSliceBoolV(*vp, !array, d)
  6932. if changed {
  6933. *vp = v
  6934. }
  6935. } else {
  6936. v := rv2i(rv).([]bool)
  6937. v2, changed := fastpathTV.DecSliceBoolV(v, !array, d)
  6938. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6939. copy(v, v2)
  6940. }
  6941. }
  6942. }
  6943. func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) {
  6944. v, changed := f.DecSliceBoolV(*vp, true, d)
  6945. if changed {
  6946. *vp = v
  6947. }
  6948. }
  6949. func (fastpathT) DecSliceBoolV(v []bool, canChange bool, d *Decoder) (_ []bool, changed bool) {
  6950. slh, containerLenS := d.decSliceHelperStart()
  6951. if containerLenS == 0 {
  6952. if canChange {
  6953. if v == nil {
  6954. v = []bool{}
  6955. } else if len(v) != 0 {
  6956. v = v[:0]
  6957. }
  6958. changed = true
  6959. }
  6960. slh.End()
  6961. return v, changed
  6962. }
  6963. d.depthIncr()
  6964. hasLen := containerLenS > 0
  6965. var xlen int
  6966. if hasLen && canChange {
  6967. if containerLenS > cap(v) {
  6968. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6969. if xlen <= cap(v) {
  6970. v = v[:uint(xlen)]
  6971. } else {
  6972. v = make([]bool, uint(xlen))
  6973. }
  6974. changed = true
  6975. } else if containerLenS != len(v) {
  6976. v = v[:containerLenS]
  6977. changed = true
  6978. }
  6979. }
  6980. var j int
  6981. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  6982. if j == 0 && len(v) == 0 && canChange {
  6983. if hasLen {
  6984. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6985. } else {
  6986. xlen = 8
  6987. }
  6988. v = make([]bool, uint(xlen))
  6989. changed = true
  6990. }
  6991. // if indefinite, etc, then expand the slice if necessary
  6992. var decodeIntoBlank bool
  6993. if j >= len(v) {
  6994. if canChange {
  6995. v = append(v, false)
  6996. changed = true
  6997. } else {
  6998. d.arrayCannotExpand(len(v), j+1)
  6999. decodeIntoBlank = true
  7000. }
  7001. }
  7002. slh.ElemContainerState(j)
  7003. if decodeIntoBlank {
  7004. d.swallow()
  7005. } else if d.d.TryDecodeAsNil() {
  7006. v[uint(j)] = false
  7007. } else {
  7008. v[uint(j)] = d.d.DecodeBool()
  7009. }
  7010. }
  7011. if canChange {
  7012. if j < len(v) {
  7013. v = v[:uint(j)]
  7014. changed = true
  7015. } else if j == 0 && v == nil {
  7016. v = make([]bool, 0)
  7017. changed = true
  7018. }
  7019. }
  7020. slh.End()
  7021. d.depthDecr()
  7022. return v, changed
  7023. }
  7024. func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  7025. if rv.Kind() == reflect.Ptr {
  7026. vp := rv2i(rv).(*map[string]interface{})
  7027. v, changed := fastpathTV.DecMapStringIntfV(*vp, true, d)
  7028. if changed {
  7029. *vp = v
  7030. }
  7031. } else {
  7032. fastpathTV.DecMapStringIntfV(rv2i(rv).(map[string]interface{}), false, d)
  7033. }
  7034. }
  7035. func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
  7036. v, changed := f.DecMapStringIntfV(*vp, true, d)
  7037. if changed {
  7038. *vp = v
  7039. }
  7040. }
  7041. func (fastpathT) DecMapStringIntfV(v map[string]interface{}, canChange bool,
  7042. d *Decoder) (_ map[string]interface{}, changed bool) {
  7043. containerLen := d.d.ReadMapStart()
  7044. if canChange && v == nil {
  7045. xlen := decInferLen(containerLen, d.h.MaxInitLen, 32)
  7046. v = make(map[string]interface{}, xlen)
  7047. changed = true
  7048. }
  7049. if containerLen == 0 {
  7050. d.d.ReadMapEnd()
  7051. return v, changed
  7052. }
  7053. d.depthIncr()
  7054. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7055. var mk string
  7056. var mv interface{}
  7057. hasLen := containerLen > 0
  7058. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7059. if d.esep {
  7060. d.d.ReadMapElemKey()
  7061. }
  7062. mk = d.d.DecodeString()
  7063. if d.esep {
  7064. d.d.ReadMapElemValue()
  7065. }
  7066. if d.d.TryDecodeAsNil() {
  7067. if v == nil {
  7068. } else if d.h.DeleteOnNilMapValue {
  7069. delete(v, mk)
  7070. } else {
  7071. v[mk] = nil
  7072. }
  7073. continue
  7074. }
  7075. if mapGet {
  7076. mv = v[mk]
  7077. } else {
  7078. mv = nil
  7079. }
  7080. d.decode(&mv)
  7081. if v != nil {
  7082. v[mk] = mv
  7083. }
  7084. }
  7085. d.d.ReadMapEnd()
  7086. d.depthDecr()
  7087. return v, changed
  7088. }
  7089. func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  7090. if rv.Kind() == reflect.Ptr {
  7091. vp := rv2i(rv).(*map[string]string)
  7092. v, changed := fastpathTV.DecMapStringStringV(*vp, true, d)
  7093. if changed {
  7094. *vp = v
  7095. }
  7096. } else {
  7097. fastpathTV.DecMapStringStringV(rv2i(rv).(map[string]string), false, d)
  7098. }
  7099. }
  7100. func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
  7101. v, changed := f.DecMapStringStringV(*vp, true, d)
  7102. if changed {
  7103. *vp = v
  7104. }
  7105. }
  7106. func (fastpathT) DecMapStringStringV(v map[string]string, canChange bool,
  7107. d *Decoder) (_ map[string]string, changed bool) {
  7108. containerLen := d.d.ReadMapStart()
  7109. if canChange && v == nil {
  7110. xlen := decInferLen(containerLen, d.h.MaxInitLen, 32)
  7111. v = make(map[string]string, xlen)
  7112. changed = true
  7113. }
  7114. if containerLen == 0 {
  7115. d.d.ReadMapEnd()
  7116. return v, changed
  7117. }
  7118. d.depthIncr()
  7119. var mk string
  7120. var mv string
  7121. hasLen := containerLen > 0
  7122. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7123. if d.esep {
  7124. d.d.ReadMapElemKey()
  7125. }
  7126. mk = d.d.DecodeString()
  7127. if d.esep {
  7128. d.d.ReadMapElemValue()
  7129. }
  7130. if d.d.TryDecodeAsNil() {
  7131. if v == nil {
  7132. } else if d.h.DeleteOnNilMapValue {
  7133. delete(v, mk)
  7134. } else {
  7135. v[mk] = ""
  7136. }
  7137. continue
  7138. }
  7139. mv = d.d.DecodeString()
  7140. if v != nil {
  7141. v[mk] = mv
  7142. }
  7143. }
  7144. d.d.ReadMapEnd()
  7145. d.depthDecr()
  7146. return v, changed
  7147. }
  7148. func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  7149. if rv.Kind() == reflect.Ptr {
  7150. vp := rv2i(rv).(*map[string]uint)
  7151. v, changed := fastpathTV.DecMapStringUintV(*vp, true, d)
  7152. if changed {
  7153. *vp = v
  7154. }
  7155. } else {
  7156. fastpathTV.DecMapStringUintV(rv2i(rv).(map[string]uint), false, d)
  7157. }
  7158. }
  7159. func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) {
  7160. v, changed := f.DecMapStringUintV(*vp, true, d)
  7161. if changed {
  7162. *vp = v
  7163. }
  7164. }
  7165. func (fastpathT) DecMapStringUintV(v map[string]uint, canChange bool,
  7166. d *Decoder) (_ map[string]uint, changed bool) {
  7167. containerLen := d.d.ReadMapStart()
  7168. if canChange && v == nil {
  7169. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7170. v = make(map[string]uint, xlen)
  7171. changed = true
  7172. }
  7173. if containerLen == 0 {
  7174. d.d.ReadMapEnd()
  7175. return v, changed
  7176. }
  7177. d.depthIncr()
  7178. var mk string
  7179. var mv uint
  7180. hasLen := containerLen > 0
  7181. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7182. if d.esep {
  7183. d.d.ReadMapElemKey()
  7184. }
  7185. mk = d.d.DecodeString()
  7186. if d.esep {
  7187. d.d.ReadMapElemValue()
  7188. }
  7189. if d.d.TryDecodeAsNil() {
  7190. if v == nil {
  7191. } else if d.h.DeleteOnNilMapValue {
  7192. delete(v, mk)
  7193. } else {
  7194. v[mk] = 0
  7195. }
  7196. continue
  7197. }
  7198. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7199. if v != nil {
  7200. v[mk] = mv
  7201. }
  7202. }
  7203. d.d.ReadMapEnd()
  7204. d.depthDecr()
  7205. return v, changed
  7206. }
  7207. func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  7208. if rv.Kind() == reflect.Ptr {
  7209. vp := rv2i(rv).(*map[string]uint8)
  7210. v, changed := fastpathTV.DecMapStringUint8V(*vp, true, d)
  7211. if changed {
  7212. *vp = v
  7213. }
  7214. } else {
  7215. fastpathTV.DecMapStringUint8V(rv2i(rv).(map[string]uint8), false, d)
  7216. }
  7217. }
  7218. func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
  7219. v, changed := f.DecMapStringUint8V(*vp, true, d)
  7220. if changed {
  7221. *vp = v
  7222. }
  7223. }
  7224. func (fastpathT) DecMapStringUint8V(v map[string]uint8, canChange bool,
  7225. d *Decoder) (_ map[string]uint8, changed bool) {
  7226. containerLen := d.d.ReadMapStart()
  7227. if canChange && v == nil {
  7228. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  7229. v = make(map[string]uint8, xlen)
  7230. changed = true
  7231. }
  7232. if containerLen == 0 {
  7233. d.d.ReadMapEnd()
  7234. return v, changed
  7235. }
  7236. d.depthIncr()
  7237. var mk string
  7238. var mv uint8
  7239. hasLen := containerLen > 0
  7240. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7241. if d.esep {
  7242. d.d.ReadMapElemKey()
  7243. }
  7244. mk = d.d.DecodeString()
  7245. if d.esep {
  7246. d.d.ReadMapElemValue()
  7247. }
  7248. if d.d.TryDecodeAsNil() {
  7249. if v == nil {
  7250. } else if d.h.DeleteOnNilMapValue {
  7251. delete(v, mk)
  7252. } else {
  7253. v[mk] = 0
  7254. }
  7255. continue
  7256. }
  7257. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7258. if v != nil {
  7259. v[mk] = mv
  7260. }
  7261. }
  7262. d.d.ReadMapEnd()
  7263. d.depthDecr()
  7264. return v, changed
  7265. }
  7266. func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  7267. if rv.Kind() == reflect.Ptr {
  7268. vp := rv2i(rv).(*map[string]uint64)
  7269. v, changed := fastpathTV.DecMapStringUint64V(*vp, true, d)
  7270. if changed {
  7271. *vp = v
  7272. }
  7273. } else {
  7274. fastpathTV.DecMapStringUint64V(rv2i(rv).(map[string]uint64), false, d)
  7275. }
  7276. }
  7277. func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
  7278. v, changed := f.DecMapStringUint64V(*vp, true, d)
  7279. if changed {
  7280. *vp = v
  7281. }
  7282. }
  7283. func (fastpathT) DecMapStringUint64V(v map[string]uint64, canChange bool,
  7284. d *Decoder) (_ map[string]uint64, changed bool) {
  7285. containerLen := d.d.ReadMapStart()
  7286. if canChange && v == nil {
  7287. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7288. v = make(map[string]uint64, xlen)
  7289. changed = true
  7290. }
  7291. if containerLen == 0 {
  7292. d.d.ReadMapEnd()
  7293. return v, changed
  7294. }
  7295. d.depthIncr()
  7296. var mk string
  7297. var mv uint64
  7298. hasLen := containerLen > 0
  7299. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7300. if d.esep {
  7301. d.d.ReadMapElemKey()
  7302. }
  7303. mk = d.d.DecodeString()
  7304. if d.esep {
  7305. d.d.ReadMapElemValue()
  7306. }
  7307. if d.d.TryDecodeAsNil() {
  7308. if v == nil {
  7309. } else if d.h.DeleteOnNilMapValue {
  7310. delete(v, mk)
  7311. } else {
  7312. v[mk] = 0
  7313. }
  7314. continue
  7315. }
  7316. mv = d.d.DecodeUint64()
  7317. if v != nil {
  7318. v[mk] = mv
  7319. }
  7320. }
  7321. d.d.ReadMapEnd()
  7322. d.depthDecr()
  7323. return v, changed
  7324. }
  7325. func (d *Decoder) fastpathDecMapStringUintptrR(f *codecFnInfo, rv reflect.Value) {
  7326. if rv.Kind() == reflect.Ptr {
  7327. vp := rv2i(rv).(*map[string]uintptr)
  7328. v, changed := fastpathTV.DecMapStringUintptrV(*vp, true, d)
  7329. if changed {
  7330. *vp = v
  7331. }
  7332. } else {
  7333. fastpathTV.DecMapStringUintptrV(rv2i(rv).(map[string]uintptr), false, d)
  7334. }
  7335. }
  7336. func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, d *Decoder) {
  7337. v, changed := f.DecMapStringUintptrV(*vp, true, d)
  7338. if changed {
  7339. *vp = v
  7340. }
  7341. }
  7342. func (fastpathT) DecMapStringUintptrV(v map[string]uintptr, canChange bool,
  7343. d *Decoder) (_ map[string]uintptr, changed bool) {
  7344. containerLen := d.d.ReadMapStart()
  7345. if canChange && v == nil {
  7346. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7347. v = make(map[string]uintptr, xlen)
  7348. changed = true
  7349. }
  7350. if containerLen == 0 {
  7351. d.d.ReadMapEnd()
  7352. return v, changed
  7353. }
  7354. d.depthIncr()
  7355. var mk string
  7356. var mv uintptr
  7357. hasLen := containerLen > 0
  7358. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7359. if d.esep {
  7360. d.d.ReadMapElemKey()
  7361. }
  7362. mk = d.d.DecodeString()
  7363. if d.esep {
  7364. d.d.ReadMapElemValue()
  7365. }
  7366. if d.d.TryDecodeAsNil() {
  7367. if v == nil {
  7368. } else if d.h.DeleteOnNilMapValue {
  7369. delete(v, mk)
  7370. } else {
  7371. v[mk] = 0
  7372. }
  7373. continue
  7374. }
  7375. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7376. if v != nil {
  7377. v[mk] = mv
  7378. }
  7379. }
  7380. d.d.ReadMapEnd()
  7381. d.depthDecr()
  7382. return v, changed
  7383. }
  7384. func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  7385. if rv.Kind() == reflect.Ptr {
  7386. vp := rv2i(rv).(*map[string]int)
  7387. v, changed := fastpathTV.DecMapStringIntV(*vp, true, d)
  7388. if changed {
  7389. *vp = v
  7390. }
  7391. } else {
  7392. fastpathTV.DecMapStringIntV(rv2i(rv).(map[string]int), false, d)
  7393. }
  7394. }
  7395. func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
  7396. v, changed := f.DecMapStringIntV(*vp, true, d)
  7397. if changed {
  7398. *vp = v
  7399. }
  7400. }
  7401. func (fastpathT) DecMapStringIntV(v map[string]int, canChange bool,
  7402. d *Decoder) (_ map[string]int, changed bool) {
  7403. containerLen := d.d.ReadMapStart()
  7404. if canChange && v == nil {
  7405. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7406. v = make(map[string]int, xlen)
  7407. changed = true
  7408. }
  7409. if containerLen == 0 {
  7410. d.d.ReadMapEnd()
  7411. return v, changed
  7412. }
  7413. d.depthIncr()
  7414. var mk string
  7415. var mv int
  7416. hasLen := containerLen > 0
  7417. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7418. if d.esep {
  7419. d.d.ReadMapElemKey()
  7420. }
  7421. mk = d.d.DecodeString()
  7422. if d.esep {
  7423. d.d.ReadMapElemValue()
  7424. }
  7425. if d.d.TryDecodeAsNil() {
  7426. if v == nil {
  7427. } else if d.h.DeleteOnNilMapValue {
  7428. delete(v, mk)
  7429. } else {
  7430. v[mk] = 0
  7431. }
  7432. continue
  7433. }
  7434. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7435. if v != nil {
  7436. v[mk] = mv
  7437. }
  7438. }
  7439. d.d.ReadMapEnd()
  7440. d.depthDecr()
  7441. return v, changed
  7442. }
  7443. func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  7444. if rv.Kind() == reflect.Ptr {
  7445. vp := rv2i(rv).(*map[string]int64)
  7446. v, changed := fastpathTV.DecMapStringInt64V(*vp, true, d)
  7447. if changed {
  7448. *vp = v
  7449. }
  7450. } else {
  7451. fastpathTV.DecMapStringInt64V(rv2i(rv).(map[string]int64), false, d)
  7452. }
  7453. }
  7454. func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) {
  7455. v, changed := f.DecMapStringInt64V(*vp, true, d)
  7456. if changed {
  7457. *vp = v
  7458. }
  7459. }
  7460. func (fastpathT) DecMapStringInt64V(v map[string]int64, canChange bool,
  7461. d *Decoder) (_ map[string]int64, changed bool) {
  7462. containerLen := d.d.ReadMapStart()
  7463. if canChange && v == nil {
  7464. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7465. v = make(map[string]int64, xlen)
  7466. changed = true
  7467. }
  7468. if containerLen == 0 {
  7469. d.d.ReadMapEnd()
  7470. return v, changed
  7471. }
  7472. d.depthIncr()
  7473. var mk string
  7474. var mv int64
  7475. hasLen := containerLen > 0
  7476. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7477. if d.esep {
  7478. d.d.ReadMapElemKey()
  7479. }
  7480. mk = d.d.DecodeString()
  7481. if d.esep {
  7482. d.d.ReadMapElemValue()
  7483. }
  7484. if d.d.TryDecodeAsNil() {
  7485. if v == nil {
  7486. } else if d.h.DeleteOnNilMapValue {
  7487. delete(v, mk)
  7488. } else {
  7489. v[mk] = 0
  7490. }
  7491. continue
  7492. }
  7493. mv = d.d.DecodeInt64()
  7494. if v != nil {
  7495. v[mk] = mv
  7496. }
  7497. }
  7498. d.d.ReadMapEnd()
  7499. d.depthDecr()
  7500. return v, changed
  7501. }
  7502. func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  7503. if rv.Kind() == reflect.Ptr {
  7504. vp := rv2i(rv).(*map[string]float32)
  7505. v, changed := fastpathTV.DecMapStringFloat32V(*vp, true, d)
  7506. if changed {
  7507. *vp = v
  7508. }
  7509. } else {
  7510. fastpathTV.DecMapStringFloat32V(rv2i(rv).(map[string]float32), false, d)
  7511. }
  7512. }
  7513. func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) {
  7514. v, changed := f.DecMapStringFloat32V(*vp, true, d)
  7515. if changed {
  7516. *vp = v
  7517. }
  7518. }
  7519. func (fastpathT) DecMapStringFloat32V(v map[string]float32, canChange bool,
  7520. d *Decoder) (_ map[string]float32, changed bool) {
  7521. containerLen := d.d.ReadMapStart()
  7522. if canChange && v == nil {
  7523. xlen := decInferLen(containerLen, d.h.MaxInitLen, 20)
  7524. v = make(map[string]float32, xlen)
  7525. changed = true
  7526. }
  7527. if containerLen == 0 {
  7528. d.d.ReadMapEnd()
  7529. return v, changed
  7530. }
  7531. d.depthIncr()
  7532. var mk string
  7533. var mv float32
  7534. hasLen := containerLen > 0
  7535. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7536. if d.esep {
  7537. d.d.ReadMapElemKey()
  7538. }
  7539. mk = d.d.DecodeString()
  7540. if d.esep {
  7541. d.d.ReadMapElemValue()
  7542. }
  7543. if d.d.TryDecodeAsNil() {
  7544. if v == nil {
  7545. } else if d.h.DeleteOnNilMapValue {
  7546. delete(v, mk)
  7547. } else {
  7548. v[mk] = 0
  7549. }
  7550. continue
  7551. }
  7552. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  7553. if v != nil {
  7554. v[mk] = mv
  7555. }
  7556. }
  7557. d.d.ReadMapEnd()
  7558. d.depthDecr()
  7559. return v, changed
  7560. }
  7561. func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  7562. if rv.Kind() == reflect.Ptr {
  7563. vp := rv2i(rv).(*map[string]float64)
  7564. v, changed := fastpathTV.DecMapStringFloat64V(*vp, true, d)
  7565. if changed {
  7566. *vp = v
  7567. }
  7568. } else {
  7569. fastpathTV.DecMapStringFloat64V(rv2i(rv).(map[string]float64), false, d)
  7570. }
  7571. }
  7572. func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
  7573. v, changed := f.DecMapStringFloat64V(*vp, true, d)
  7574. if changed {
  7575. *vp = v
  7576. }
  7577. }
  7578. func (fastpathT) DecMapStringFloat64V(v map[string]float64, canChange bool,
  7579. d *Decoder) (_ map[string]float64, changed bool) {
  7580. containerLen := d.d.ReadMapStart()
  7581. if canChange && v == nil {
  7582. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7583. v = make(map[string]float64, xlen)
  7584. changed = true
  7585. }
  7586. if containerLen == 0 {
  7587. d.d.ReadMapEnd()
  7588. return v, changed
  7589. }
  7590. d.depthIncr()
  7591. var mk string
  7592. var mv float64
  7593. hasLen := containerLen > 0
  7594. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7595. if d.esep {
  7596. d.d.ReadMapElemKey()
  7597. }
  7598. mk = d.d.DecodeString()
  7599. if d.esep {
  7600. d.d.ReadMapElemValue()
  7601. }
  7602. if d.d.TryDecodeAsNil() {
  7603. if v == nil {
  7604. } else if d.h.DeleteOnNilMapValue {
  7605. delete(v, mk)
  7606. } else {
  7607. v[mk] = 0
  7608. }
  7609. continue
  7610. }
  7611. mv = d.d.DecodeFloat64()
  7612. if v != nil {
  7613. v[mk] = mv
  7614. }
  7615. }
  7616. d.d.ReadMapEnd()
  7617. d.depthDecr()
  7618. return v, changed
  7619. }
  7620. func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  7621. if rv.Kind() == reflect.Ptr {
  7622. vp := rv2i(rv).(*map[string]bool)
  7623. v, changed := fastpathTV.DecMapStringBoolV(*vp, true, d)
  7624. if changed {
  7625. *vp = v
  7626. }
  7627. } else {
  7628. fastpathTV.DecMapStringBoolV(rv2i(rv).(map[string]bool), false, d)
  7629. }
  7630. }
  7631. func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
  7632. v, changed := f.DecMapStringBoolV(*vp, true, d)
  7633. if changed {
  7634. *vp = v
  7635. }
  7636. }
  7637. func (fastpathT) DecMapStringBoolV(v map[string]bool, canChange bool,
  7638. d *Decoder) (_ map[string]bool, changed bool) {
  7639. containerLen := d.d.ReadMapStart()
  7640. if canChange && v == nil {
  7641. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  7642. v = make(map[string]bool, xlen)
  7643. changed = true
  7644. }
  7645. if containerLen == 0 {
  7646. d.d.ReadMapEnd()
  7647. return v, changed
  7648. }
  7649. d.depthIncr()
  7650. var mk string
  7651. var mv bool
  7652. hasLen := containerLen > 0
  7653. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7654. if d.esep {
  7655. d.d.ReadMapElemKey()
  7656. }
  7657. mk = d.d.DecodeString()
  7658. if d.esep {
  7659. d.d.ReadMapElemValue()
  7660. }
  7661. if d.d.TryDecodeAsNil() {
  7662. if v == nil {
  7663. } else if d.h.DeleteOnNilMapValue {
  7664. delete(v, mk)
  7665. } else {
  7666. v[mk] = false
  7667. }
  7668. continue
  7669. }
  7670. mv = d.d.DecodeBool()
  7671. if v != nil {
  7672. v[mk] = mv
  7673. }
  7674. }
  7675. d.d.ReadMapEnd()
  7676. d.depthDecr()
  7677. return v, changed
  7678. }
  7679. func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  7680. if rv.Kind() == reflect.Ptr {
  7681. vp := rv2i(rv).(*map[uint]interface{})
  7682. v, changed := fastpathTV.DecMapUintIntfV(*vp, true, d)
  7683. if changed {
  7684. *vp = v
  7685. }
  7686. } else {
  7687. fastpathTV.DecMapUintIntfV(rv2i(rv).(map[uint]interface{}), false, d)
  7688. }
  7689. }
  7690. func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) {
  7691. v, changed := f.DecMapUintIntfV(*vp, true, d)
  7692. if changed {
  7693. *vp = v
  7694. }
  7695. }
  7696. func (fastpathT) DecMapUintIntfV(v map[uint]interface{}, canChange bool,
  7697. d *Decoder) (_ map[uint]interface{}, changed bool) {
  7698. containerLen := d.d.ReadMapStart()
  7699. if canChange && v == nil {
  7700. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7701. v = make(map[uint]interface{}, xlen)
  7702. changed = true
  7703. }
  7704. if containerLen == 0 {
  7705. d.d.ReadMapEnd()
  7706. return v, changed
  7707. }
  7708. d.depthIncr()
  7709. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7710. var mk uint
  7711. var mv interface{}
  7712. hasLen := containerLen > 0
  7713. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7714. if d.esep {
  7715. d.d.ReadMapElemKey()
  7716. }
  7717. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7718. if d.esep {
  7719. d.d.ReadMapElemValue()
  7720. }
  7721. if d.d.TryDecodeAsNil() {
  7722. if v == nil {
  7723. } else if d.h.DeleteOnNilMapValue {
  7724. delete(v, mk)
  7725. } else {
  7726. v[mk] = nil
  7727. }
  7728. continue
  7729. }
  7730. if mapGet {
  7731. mv = v[mk]
  7732. } else {
  7733. mv = nil
  7734. }
  7735. d.decode(&mv)
  7736. if v != nil {
  7737. v[mk] = mv
  7738. }
  7739. }
  7740. d.d.ReadMapEnd()
  7741. d.depthDecr()
  7742. return v, changed
  7743. }
  7744. func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  7745. if rv.Kind() == reflect.Ptr {
  7746. vp := rv2i(rv).(*map[uint]string)
  7747. v, changed := fastpathTV.DecMapUintStringV(*vp, true, d)
  7748. if changed {
  7749. *vp = v
  7750. }
  7751. } else {
  7752. fastpathTV.DecMapUintStringV(rv2i(rv).(map[uint]string), false, d)
  7753. }
  7754. }
  7755. func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) {
  7756. v, changed := f.DecMapUintStringV(*vp, true, d)
  7757. if changed {
  7758. *vp = v
  7759. }
  7760. }
  7761. func (fastpathT) DecMapUintStringV(v map[uint]string, canChange bool,
  7762. d *Decoder) (_ map[uint]string, changed bool) {
  7763. containerLen := d.d.ReadMapStart()
  7764. if canChange && v == nil {
  7765. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7766. v = make(map[uint]string, xlen)
  7767. changed = true
  7768. }
  7769. if containerLen == 0 {
  7770. d.d.ReadMapEnd()
  7771. return v, changed
  7772. }
  7773. d.depthIncr()
  7774. var mk uint
  7775. var mv string
  7776. hasLen := containerLen > 0
  7777. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7778. if d.esep {
  7779. d.d.ReadMapElemKey()
  7780. }
  7781. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7782. if d.esep {
  7783. d.d.ReadMapElemValue()
  7784. }
  7785. if d.d.TryDecodeAsNil() {
  7786. if v == nil {
  7787. } else if d.h.DeleteOnNilMapValue {
  7788. delete(v, mk)
  7789. } else {
  7790. v[mk] = ""
  7791. }
  7792. continue
  7793. }
  7794. mv = d.d.DecodeString()
  7795. if v != nil {
  7796. v[mk] = mv
  7797. }
  7798. }
  7799. d.d.ReadMapEnd()
  7800. d.depthDecr()
  7801. return v, changed
  7802. }
  7803. func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  7804. if rv.Kind() == reflect.Ptr {
  7805. vp := rv2i(rv).(*map[uint]uint)
  7806. v, changed := fastpathTV.DecMapUintUintV(*vp, true, d)
  7807. if changed {
  7808. *vp = v
  7809. }
  7810. } else {
  7811. fastpathTV.DecMapUintUintV(rv2i(rv).(map[uint]uint), false, d)
  7812. }
  7813. }
  7814. func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) {
  7815. v, changed := f.DecMapUintUintV(*vp, true, d)
  7816. if changed {
  7817. *vp = v
  7818. }
  7819. }
  7820. func (fastpathT) DecMapUintUintV(v map[uint]uint, canChange bool,
  7821. d *Decoder) (_ map[uint]uint, changed bool) {
  7822. containerLen := d.d.ReadMapStart()
  7823. if canChange && v == nil {
  7824. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  7825. v = make(map[uint]uint, xlen)
  7826. changed = true
  7827. }
  7828. if containerLen == 0 {
  7829. d.d.ReadMapEnd()
  7830. return v, changed
  7831. }
  7832. d.depthIncr()
  7833. var mk uint
  7834. var mv uint
  7835. hasLen := containerLen > 0
  7836. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7837. if d.esep {
  7838. d.d.ReadMapElemKey()
  7839. }
  7840. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7841. if d.esep {
  7842. d.d.ReadMapElemValue()
  7843. }
  7844. if d.d.TryDecodeAsNil() {
  7845. if v == nil {
  7846. } else if d.h.DeleteOnNilMapValue {
  7847. delete(v, mk)
  7848. } else {
  7849. v[mk] = 0
  7850. }
  7851. continue
  7852. }
  7853. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7854. if v != nil {
  7855. v[mk] = mv
  7856. }
  7857. }
  7858. d.d.ReadMapEnd()
  7859. d.depthDecr()
  7860. return v, changed
  7861. }
  7862. func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  7863. if rv.Kind() == reflect.Ptr {
  7864. vp := rv2i(rv).(*map[uint]uint8)
  7865. v, changed := fastpathTV.DecMapUintUint8V(*vp, true, d)
  7866. if changed {
  7867. *vp = v
  7868. }
  7869. } else {
  7870. fastpathTV.DecMapUintUint8V(rv2i(rv).(map[uint]uint8), false, d)
  7871. }
  7872. }
  7873. func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) {
  7874. v, changed := f.DecMapUintUint8V(*vp, true, d)
  7875. if changed {
  7876. *vp = v
  7877. }
  7878. }
  7879. func (fastpathT) DecMapUintUint8V(v map[uint]uint8, canChange bool,
  7880. d *Decoder) (_ map[uint]uint8, changed bool) {
  7881. containerLen := d.d.ReadMapStart()
  7882. if canChange && v == nil {
  7883. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  7884. v = make(map[uint]uint8, xlen)
  7885. changed = true
  7886. }
  7887. if containerLen == 0 {
  7888. d.d.ReadMapEnd()
  7889. return v, changed
  7890. }
  7891. d.depthIncr()
  7892. var mk uint
  7893. var mv uint8
  7894. hasLen := containerLen > 0
  7895. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7896. if d.esep {
  7897. d.d.ReadMapElemKey()
  7898. }
  7899. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7900. if d.esep {
  7901. d.d.ReadMapElemValue()
  7902. }
  7903. if d.d.TryDecodeAsNil() {
  7904. if v == nil {
  7905. } else if d.h.DeleteOnNilMapValue {
  7906. delete(v, mk)
  7907. } else {
  7908. v[mk] = 0
  7909. }
  7910. continue
  7911. }
  7912. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7913. if v != nil {
  7914. v[mk] = mv
  7915. }
  7916. }
  7917. d.d.ReadMapEnd()
  7918. d.depthDecr()
  7919. return v, changed
  7920. }
  7921. func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  7922. if rv.Kind() == reflect.Ptr {
  7923. vp := rv2i(rv).(*map[uint]uint64)
  7924. v, changed := fastpathTV.DecMapUintUint64V(*vp, true, d)
  7925. if changed {
  7926. *vp = v
  7927. }
  7928. } else {
  7929. fastpathTV.DecMapUintUint64V(rv2i(rv).(map[uint]uint64), false, d)
  7930. }
  7931. }
  7932. func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) {
  7933. v, changed := f.DecMapUintUint64V(*vp, true, d)
  7934. if changed {
  7935. *vp = v
  7936. }
  7937. }
  7938. func (fastpathT) DecMapUintUint64V(v map[uint]uint64, canChange bool,
  7939. d *Decoder) (_ map[uint]uint64, changed bool) {
  7940. containerLen := d.d.ReadMapStart()
  7941. if canChange && v == nil {
  7942. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  7943. v = make(map[uint]uint64, xlen)
  7944. changed = true
  7945. }
  7946. if containerLen == 0 {
  7947. d.d.ReadMapEnd()
  7948. return v, changed
  7949. }
  7950. d.depthIncr()
  7951. var mk uint
  7952. var mv uint64
  7953. hasLen := containerLen > 0
  7954. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7955. if d.esep {
  7956. d.d.ReadMapElemKey()
  7957. }
  7958. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7959. if d.esep {
  7960. d.d.ReadMapElemValue()
  7961. }
  7962. if d.d.TryDecodeAsNil() {
  7963. if v == nil {
  7964. } else if d.h.DeleteOnNilMapValue {
  7965. delete(v, mk)
  7966. } else {
  7967. v[mk] = 0
  7968. }
  7969. continue
  7970. }
  7971. mv = d.d.DecodeUint64()
  7972. if v != nil {
  7973. v[mk] = mv
  7974. }
  7975. }
  7976. d.d.ReadMapEnd()
  7977. d.depthDecr()
  7978. return v, changed
  7979. }
  7980. func (d *Decoder) fastpathDecMapUintUintptrR(f *codecFnInfo, rv reflect.Value) {
  7981. if rv.Kind() == reflect.Ptr {
  7982. vp := rv2i(rv).(*map[uint]uintptr)
  7983. v, changed := fastpathTV.DecMapUintUintptrV(*vp, true, d)
  7984. if changed {
  7985. *vp = v
  7986. }
  7987. } else {
  7988. fastpathTV.DecMapUintUintptrV(rv2i(rv).(map[uint]uintptr), false, d)
  7989. }
  7990. }
  7991. func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, d *Decoder) {
  7992. v, changed := f.DecMapUintUintptrV(*vp, true, d)
  7993. if changed {
  7994. *vp = v
  7995. }
  7996. }
  7997. func (fastpathT) DecMapUintUintptrV(v map[uint]uintptr, canChange bool,
  7998. d *Decoder) (_ map[uint]uintptr, changed bool) {
  7999. containerLen := d.d.ReadMapStart()
  8000. if canChange && v == nil {
  8001. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8002. v = make(map[uint]uintptr, xlen)
  8003. changed = true
  8004. }
  8005. if containerLen == 0 {
  8006. d.d.ReadMapEnd()
  8007. return v, changed
  8008. }
  8009. d.depthIncr()
  8010. var mk uint
  8011. var mv uintptr
  8012. hasLen := containerLen > 0
  8013. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8014. if d.esep {
  8015. d.d.ReadMapElemKey()
  8016. }
  8017. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8018. if d.esep {
  8019. d.d.ReadMapElemValue()
  8020. }
  8021. if d.d.TryDecodeAsNil() {
  8022. if v == nil {
  8023. } else if d.h.DeleteOnNilMapValue {
  8024. delete(v, mk)
  8025. } else {
  8026. v[mk] = 0
  8027. }
  8028. continue
  8029. }
  8030. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8031. if v != nil {
  8032. v[mk] = mv
  8033. }
  8034. }
  8035. d.d.ReadMapEnd()
  8036. d.depthDecr()
  8037. return v, changed
  8038. }
  8039. func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  8040. if rv.Kind() == reflect.Ptr {
  8041. vp := rv2i(rv).(*map[uint]int)
  8042. v, changed := fastpathTV.DecMapUintIntV(*vp, true, d)
  8043. if changed {
  8044. *vp = v
  8045. }
  8046. } else {
  8047. fastpathTV.DecMapUintIntV(rv2i(rv).(map[uint]int), false, d)
  8048. }
  8049. }
  8050. func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) {
  8051. v, changed := f.DecMapUintIntV(*vp, true, d)
  8052. if changed {
  8053. *vp = v
  8054. }
  8055. }
  8056. func (fastpathT) DecMapUintIntV(v map[uint]int, canChange bool,
  8057. d *Decoder) (_ map[uint]int, changed bool) {
  8058. containerLen := d.d.ReadMapStart()
  8059. if canChange && v == nil {
  8060. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8061. v = make(map[uint]int, xlen)
  8062. changed = true
  8063. }
  8064. if containerLen == 0 {
  8065. d.d.ReadMapEnd()
  8066. return v, changed
  8067. }
  8068. d.depthIncr()
  8069. var mk uint
  8070. var mv int
  8071. hasLen := containerLen > 0
  8072. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8073. if d.esep {
  8074. d.d.ReadMapElemKey()
  8075. }
  8076. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8077. if d.esep {
  8078. d.d.ReadMapElemValue()
  8079. }
  8080. if d.d.TryDecodeAsNil() {
  8081. if v == nil {
  8082. } else if d.h.DeleteOnNilMapValue {
  8083. delete(v, mk)
  8084. } else {
  8085. v[mk] = 0
  8086. }
  8087. continue
  8088. }
  8089. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8090. if v != nil {
  8091. v[mk] = mv
  8092. }
  8093. }
  8094. d.d.ReadMapEnd()
  8095. d.depthDecr()
  8096. return v, changed
  8097. }
  8098. func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  8099. if rv.Kind() == reflect.Ptr {
  8100. vp := rv2i(rv).(*map[uint]int64)
  8101. v, changed := fastpathTV.DecMapUintInt64V(*vp, true, d)
  8102. if changed {
  8103. *vp = v
  8104. }
  8105. } else {
  8106. fastpathTV.DecMapUintInt64V(rv2i(rv).(map[uint]int64), false, d)
  8107. }
  8108. }
  8109. func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) {
  8110. v, changed := f.DecMapUintInt64V(*vp, true, d)
  8111. if changed {
  8112. *vp = v
  8113. }
  8114. }
  8115. func (fastpathT) DecMapUintInt64V(v map[uint]int64, canChange bool,
  8116. d *Decoder) (_ map[uint]int64, changed bool) {
  8117. containerLen := d.d.ReadMapStart()
  8118. if canChange && v == nil {
  8119. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8120. v = make(map[uint]int64, xlen)
  8121. changed = true
  8122. }
  8123. if containerLen == 0 {
  8124. d.d.ReadMapEnd()
  8125. return v, changed
  8126. }
  8127. d.depthIncr()
  8128. var mk uint
  8129. var mv int64
  8130. hasLen := containerLen > 0
  8131. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8132. if d.esep {
  8133. d.d.ReadMapElemKey()
  8134. }
  8135. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8136. if d.esep {
  8137. d.d.ReadMapElemValue()
  8138. }
  8139. if d.d.TryDecodeAsNil() {
  8140. if v == nil {
  8141. } else if d.h.DeleteOnNilMapValue {
  8142. delete(v, mk)
  8143. } else {
  8144. v[mk] = 0
  8145. }
  8146. continue
  8147. }
  8148. mv = d.d.DecodeInt64()
  8149. if v != nil {
  8150. v[mk] = mv
  8151. }
  8152. }
  8153. d.d.ReadMapEnd()
  8154. d.depthDecr()
  8155. return v, changed
  8156. }
  8157. func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  8158. if rv.Kind() == reflect.Ptr {
  8159. vp := rv2i(rv).(*map[uint]float32)
  8160. v, changed := fastpathTV.DecMapUintFloat32V(*vp, true, d)
  8161. if changed {
  8162. *vp = v
  8163. }
  8164. } else {
  8165. fastpathTV.DecMapUintFloat32V(rv2i(rv).(map[uint]float32), false, d)
  8166. }
  8167. }
  8168. func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) {
  8169. v, changed := f.DecMapUintFloat32V(*vp, true, d)
  8170. if changed {
  8171. *vp = v
  8172. }
  8173. }
  8174. func (fastpathT) DecMapUintFloat32V(v map[uint]float32, canChange bool,
  8175. d *Decoder) (_ map[uint]float32, changed bool) {
  8176. containerLen := d.d.ReadMapStart()
  8177. if canChange && v == nil {
  8178. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  8179. v = make(map[uint]float32, xlen)
  8180. changed = true
  8181. }
  8182. if containerLen == 0 {
  8183. d.d.ReadMapEnd()
  8184. return v, changed
  8185. }
  8186. d.depthIncr()
  8187. var mk uint
  8188. var mv float32
  8189. hasLen := containerLen > 0
  8190. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8191. if d.esep {
  8192. d.d.ReadMapElemKey()
  8193. }
  8194. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8195. if d.esep {
  8196. d.d.ReadMapElemValue()
  8197. }
  8198. if d.d.TryDecodeAsNil() {
  8199. if v == nil {
  8200. } else if d.h.DeleteOnNilMapValue {
  8201. delete(v, mk)
  8202. } else {
  8203. v[mk] = 0
  8204. }
  8205. continue
  8206. }
  8207. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  8208. if v != nil {
  8209. v[mk] = mv
  8210. }
  8211. }
  8212. d.d.ReadMapEnd()
  8213. d.depthDecr()
  8214. return v, changed
  8215. }
  8216. func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  8217. if rv.Kind() == reflect.Ptr {
  8218. vp := rv2i(rv).(*map[uint]float64)
  8219. v, changed := fastpathTV.DecMapUintFloat64V(*vp, true, d)
  8220. if changed {
  8221. *vp = v
  8222. }
  8223. } else {
  8224. fastpathTV.DecMapUintFloat64V(rv2i(rv).(map[uint]float64), false, d)
  8225. }
  8226. }
  8227. func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) {
  8228. v, changed := f.DecMapUintFloat64V(*vp, true, d)
  8229. if changed {
  8230. *vp = v
  8231. }
  8232. }
  8233. func (fastpathT) DecMapUintFloat64V(v map[uint]float64, canChange bool,
  8234. d *Decoder) (_ map[uint]float64, changed bool) {
  8235. containerLen := d.d.ReadMapStart()
  8236. if canChange && v == nil {
  8237. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8238. v = make(map[uint]float64, xlen)
  8239. changed = true
  8240. }
  8241. if containerLen == 0 {
  8242. d.d.ReadMapEnd()
  8243. return v, changed
  8244. }
  8245. d.depthIncr()
  8246. var mk uint
  8247. var mv float64
  8248. hasLen := containerLen > 0
  8249. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8250. if d.esep {
  8251. d.d.ReadMapElemKey()
  8252. }
  8253. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8254. if d.esep {
  8255. d.d.ReadMapElemValue()
  8256. }
  8257. if d.d.TryDecodeAsNil() {
  8258. if v == nil {
  8259. } else if d.h.DeleteOnNilMapValue {
  8260. delete(v, mk)
  8261. } else {
  8262. v[mk] = 0
  8263. }
  8264. continue
  8265. }
  8266. mv = d.d.DecodeFloat64()
  8267. if v != nil {
  8268. v[mk] = mv
  8269. }
  8270. }
  8271. d.d.ReadMapEnd()
  8272. d.depthDecr()
  8273. return v, changed
  8274. }
  8275. func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  8276. if rv.Kind() == reflect.Ptr {
  8277. vp := rv2i(rv).(*map[uint]bool)
  8278. v, changed := fastpathTV.DecMapUintBoolV(*vp, true, d)
  8279. if changed {
  8280. *vp = v
  8281. }
  8282. } else {
  8283. fastpathTV.DecMapUintBoolV(rv2i(rv).(map[uint]bool), false, d)
  8284. }
  8285. }
  8286. func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) {
  8287. v, changed := f.DecMapUintBoolV(*vp, true, d)
  8288. if changed {
  8289. *vp = v
  8290. }
  8291. }
  8292. func (fastpathT) DecMapUintBoolV(v map[uint]bool, canChange bool,
  8293. d *Decoder) (_ map[uint]bool, changed bool) {
  8294. containerLen := d.d.ReadMapStart()
  8295. if canChange && v == nil {
  8296. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8297. v = make(map[uint]bool, xlen)
  8298. changed = true
  8299. }
  8300. if containerLen == 0 {
  8301. d.d.ReadMapEnd()
  8302. return v, changed
  8303. }
  8304. d.depthIncr()
  8305. var mk uint
  8306. var mv bool
  8307. hasLen := containerLen > 0
  8308. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8309. if d.esep {
  8310. d.d.ReadMapElemKey()
  8311. }
  8312. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8313. if d.esep {
  8314. d.d.ReadMapElemValue()
  8315. }
  8316. if d.d.TryDecodeAsNil() {
  8317. if v == nil {
  8318. } else if d.h.DeleteOnNilMapValue {
  8319. delete(v, mk)
  8320. } else {
  8321. v[mk] = false
  8322. }
  8323. continue
  8324. }
  8325. mv = d.d.DecodeBool()
  8326. if v != nil {
  8327. v[mk] = mv
  8328. }
  8329. }
  8330. d.d.ReadMapEnd()
  8331. d.depthDecr()
  8332. return v, changed
  8333. }
  8334. func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  8335. if rv.Kind() == reflect.Ptr {
  8336. vp := rv2i(rv).(*map[uint8]interface{})
  8337. v, changed := fastpathTV.DecMapUint8IntfV(*vp, true, d)
  8338. if changed {
  8339. *vp = v
  8340. }
  8341. } else {
  8342. fastpathTV.DecMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), false, d)
  8343. }
  8344. }
  8345. func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
  8346. v, changed := f.DecMapUint8IntfV(*vp, true, d)
  8347. if changed {
  8348. *vp = v
  8349. }
  8350. }
  8351. func (fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, canChange bool,
  8352. d *Decoder) (_ map[uint8]interface{}, changed bool) {
  8353. containerLen := d.d.ReadMapStart()
  8354. if canChange && v == nil {
  8355. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  8356. v = make(map[uint8]interface{}, xlen)
  8357. changed = true
  8358. }
  8359. if containerLen == 0 {
  8360. d.d.ReadMapEnd()
  8361. return v, changed
  8362. }
  8363. d.depthIncr()
  8364. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  8365. var mk uint8
  8366. var mv interface{}
  8367. hasLen := containerLen > 0
  8368. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8369. if d.esep {
  8370. d.d.ReadMapElemKey()
  8371. }
  8372. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8373. if d.esep {
  8374. d.d.ReadMapElemValue()
  8375. }
  8376. if d.d.TryDecodeAsNil() {
  8377. if v == nil {
  8378. } else if d.h.DeleteOnNilMapValue {
  8379. delete(v, mk)
  8380. } else {
  8381. v[mk] = nil
  8382. }
  8383. continue
  8384. }
  8385. if mapGet {
  8386. mv = v[mk]
  8387. } else {
  8388. mv = nil
  8389. }
  8390. d.decode(&mv)
  8391. if v != nil {
  8392. v[mk] = mv
  8393. }
  8394. }
  8395. d.d.ReadMapEnd()
  8396. d.depthDecr()
  8397. return v, changed
  8398. }
  8399. func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  8400. if rv.Kind() == reflect.Ptr {
  8401. vp := rv2i(rv).(*map[uint8]string)
  8402. v, changed := fastpathTV.DecMapUint8StringV(*vp, true, d)
  8403. if changed {
  8404. *vp = v
  8405. }
  8406. } else {
  8407. fastpathTV.DecMapUint8StringV(rv2i(rv).(map[uint8]string), false, d)
  8408. }
  8409. }
  8410. func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
  8411. v, changed := f.DecMapUint8StringV(*vp, true, d)
  8412. if changed {
  8413. *vp = v
  8414. }
  8415. }
  8416. func (fastpathT) DecMapUint8StringV(v map[uint8]string, canChange bool,
  8417. d *Decoder) (_ map[uint8]string, changed bool) {
  8418. containerLen := d.d.ReadMapStart()
  8419. if canChange && v == nil {
  8420. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  8421. v = make(map[uint8]string, xlen)
  8422. changed = true
  8423. }
  8424. if containerLen == 0 {
  8425. d.d.ReadMapEnd()
  8426. return v, changed
  8427. }
  8428. d.depthIncr()
  8429. var mk uint8
  8430. var mv string
  8431. hasLen := containerLen > 0
  8432. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8433. if d.esep {
  8434. d.d.ReadMapElemKey()
  8435. }
  8436. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8437. if d.esep {
  8438. d.d.ReadMapElemValue()
  8439. }
  8440. if d.d.TryDecodeAsNil() {
  8441. if v == nil {
  8442. } else if d.h.DeleteOnNilMapValue {
  8443. delete(v, mk)
  8444. } else {
  8445. v[mk] = ""
  8446. }
  8447. continue
  8448. }
  8449. mv = d.d.DecodeString()
  8450. if v != nil {
  8451. v[mk] = mv
  8452. }
  8453. }
  8454. d.d.ReadMapEnd()
  8455. d.depthDecr()
  8456. return v, changed
  8457. }
  8458. func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  8459. if rv.Kind() == reflect.Ptr {
  8460. vp := rv2i(rv).(*map[uint8]uint)
  8461. v, changed := fastpathTV.DecMapUint8UintV(*vp, true, d)
  8462. if changed {
  8463. *vp = v
  8464. }
  8465. } else {
  8466. fastpathTV.DecMapUint8UintV(rv2i(rv).(map[uint8]uint), false, d)
  8467. }
  8468. }
  8469. func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) {
  8470. v, changed := f.DecMapUint8UintV(*vp, true, d)
  8471. if changed {
  8472. *vp = v
  8473. }
  8474. }
  8475. func (fastpathT) DecMapUint8UintV(v map[uint8]uint, canChange bool,
  8476. d *Decoder) (_ map[uint8]uint, changed bool) {
  8477. containerLen := d.d.ReadMapStart()
  8478. if canChange && v == nil {
  8479. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8480. v = make(map[uint8]uint, xlen)
  8481. changed = true
  8482. }
  8483. if containerLen == 0 {
  8484. d.d.ReadMapEnd()
  8485. return v, changed
  8486. }
  8487. d.depthIncr()
  8488. var mk uint8
  8489. var mv uint
  8490. hasLen := containerLen > 0
  8491. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8492. if d.esep {
  8493. d.d.ReadMapElemKey()
  8494. }
  8495. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8496. if d.esep {
  8497. d.d.ReadMapElemValue()
  8498. }
  8499. if d.d.TryDecodeAsNil() {
  8500. if v == nil {
  8501. } else if d.h.DeleteOnNilMapValue {
  8502. delete(v, mk)
  8503. } else {
  8504. v[mk] = 0
  8505. }
  8506. continue
  8507. }
  8508. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8509. if v != nil {
  8510. v[mk] = mv
  8511. }
  8512. }
  8513. d.d.ReadMapEnd()
  8514. d.depthDecr()
  8515. return v, changed
  8516. }
  8517. func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  8518. if rv.Kind() == reflect.Ptr {
  8519. vp := rv2i(rv).(*map[uint8]uint8)
  8520. v, changed := fastpathTV.DecMapUint8Uint8V(*vp, true, d)
  8521. if changed {
  8522. *vp = v
  8523. }
  8524. } else {
  8525. fastpathTV.DecMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), false, d)
  8526. }
  8527. }
  8528. func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
  8529. v, changed := f.DecMapUint8Uint8V(*vp, true, d)
  8530. if changed {
  8531. *vp = v
  8532. }
  8533. }
  8534. func (fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, canChange bool,
  8535. d *Decoder) (_ map[uint8]uint8, changed bool) {
  8536. containerLen := d.d.ReadMapStart()
  8537. if canChange && v == nil {
  8538. xlen := decInferLen(containerLen, d.h.MaxInitLen, 2)
  8539. v = make(map[uint8]uint8, xlen)
  8540. changed = true
  8541. }
  8542. if containerLen == 0 {
  8543. d.d.ReadMapEnd()
  8544. return v, changed
  8545. }
  8546. d.depthIncr()
  8547. var mk uint8
  8548. var mv uint8
  8549. hasLen := containerLen > 0
  8550. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8551. if d.esep {
  8552. d.d.ReadMapElemKey()
  8553. }
  8554. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8555. if d.esep {
  8556. d.d.ReadMapElemValue()
  8557. }
  8558. if d.d.TryDecodeAsNil() {
  8559. if v == nil {
  8560. } else if d.h.DeleteOnNilMapValue {
  8561. delete(v, mk)
  8562. } else {
  8563. v[mk] = 0
  8564. }
  8565. continue
  8566. }
  8567. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8568. if v != nil {
  8569. v[mk] = mv
  8570. }
  8571. }
  8572. d.d.ReadMapEnd()
  8573. d.depthDecr()
  8574. return v, changed
  8575. }
  8576. func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  8577. if rv.Kind() == reflect.Ptr {
  8578. vp := rv2i(rv).(*map[uint8]uint64)
  8579. v, changed := fastpathTV.DecMapUint8Uint64V(*vp, true, d)
  8580. if changed {
  8581. *vp = v
  8582. }
  8583. } else {
  8584. fastpathTV.DecMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), false, d)
  8585. }
  8586. }
  8587. func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
  8588. v, changed := f.DecMapUint8Uint64V(*vp, true, d)
  8589. if changed {
  8590. *vp = v
  8591. }
  8592. }
  8593. func (fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, canChange bool,
  8594. d *Decoder) (_ map[uint8]uint64, changed bool) {
  8595. containerLen := d.d.ReadMapStart()
  8596. if canChange && v == nil {
  8597. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8598. v = make(map[uint8]uint64, xlen)
  8599. changed = true
  8600. }
  8601. if containerLen == 0 {
  8602. d.d.ReadMapEnd()
  8603. return v, changed
  8604. }
  8605. d.depthIncr()
  8606. var mk uint8
  8607. var mv uint64
  8608. hasLen := containerLen > 0
  8609. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8610. if d.esep {
  8611. d.d.ReadMapElemKey()
  8612. }
  8613. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8614. if d.esep {
  8615. d.d.ReadMapElemValue()
  8616. }
  8617. if d.d.TryDecodeAsNil() {
  8618. if v == nil {
  8619. } else if d.h.DeleteOnNilMapValue {
  8620. delete(v, mk)
  8621. } else {
  8622. v[mk] = 0
  8623. }
  8624. continue
  8625. }
  8626. mv = d.d.DecodeUint64()
  8627. if v != nil {
  8628. v[mk] = mv
  8629. }
  8630. }
  8631. d.d.ReadMapEnd()
  8632. d.depthDecr()
  8633. return v, changed
  8634. }
  8635. func (d *Decoder) fastpathDecMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) {
  8636. if rv.Kind() == reflect.Ptr {
  8637. vp := rv2i(rv).(*map[uint8]uintptr)
  8638. v, changed := fastpathTV.DecMapUint8UintptrV(*vp, true, d)
  8639. if changed {
  8640. *vp = v
  8641. }
  8642. } else {
  8643. fastpathTV.DecMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), false, d)
  8644. }
  8645. }
  8646. func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, d *Decoder) {
  8647. v, changed := f.DecMapUint8UintptrV(*vp, true, d)
  8648. if changed {
  8649. *vp = v
  8650. }
  8651. }
  8652. func (fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, canChange bool,
  8653. d *Decoder) (_ map[uint8]uintptr, changed bool) {
  8654. containerLen := d.d.ReadMapStart()
  8655. if canChange && v == nil {
  8656. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8657. v = make(map[uint8]uintptr, xlen)
  8658. changed = true
  8659. }
  8660. if containerLen == 0 {
  8661. d.d.ReadMapEnd()
  8662. return v, changed
  8663. }
  8664. d.depthIncr()
  8665. var mk uint8
  8666. var mv uintptr
  8667. hasLen := containerLen > 0
  8668. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8669. if d.esep {
  8670. d.d.ReadMapElemKey()
  8671. }
  8672. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8673. if d.esep {
  8674. d.d.ReadMapElemValue()
  8675. }
  8676. if d.d.TryDecodeAsNil() {
  8677. if v == nil {
  8678. } else if d.h.DeleteOnNilMapValue {
  8679. delete(v, mk)
  8680. } else {
  8681. v[mk] = 0
  8682. }
  8683. continue
  8684. }
  8685. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8686. if v != nil {
  8687. v[mk] = mv
  8688. }
  8689. }
  8690. d.d.ReadMapEnd()
  8691. d.depthDecr()
  8692. return v, changed
  8693. }
  8694. func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  8695. if rv.Kind() == reflect.Ptr {
  8696. vp := rv2i(rv).(*map[uint8]int)
  8697. v, changed := fastpathTV.DecMapUint8IntV(*vp, true, d)
  8698. if changed {
  8699. *vp = v
  8700. }
  8701. } else {
  8702. fastpathTV.DecMapUint8IntV(rv2i(rv).(map[uint8]int), false, d)
  8703. }
  8704. }
  8705. func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
  8706. v, changed := f.DecMapUint8IntV(*vp, true, d)
  8707. if changed {
  8708. *vp = v
  8709. }
  8710. }
  8711. func (fastpathT) DecMapUint8IntV(v map[uint8]int, canChange bool,
  8712. d *Decoder) (_ map[uint8]int, changed bool) {
  8713. containerLen := d.d.ReadMapStart()
  8714. if canChange && v == nil {
  8715. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8716. v = make(map[uint8]int, xlen)
  8717. changed = true
  8718. }
  8719. if containerLen == 0 {
  8720. d.d.ReadMapEnd()
  8721. return v, changed
  8722. }
  8723. d.depthIncr()
  8724. var mk uint8
  8725. var mv int
  8726. hasLen := containerLen > 0
  8727. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8728. if d.esep {
  8729. d.d.ReadMapElemKey()
  8730. }
  8731. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8732. if d.esep {
  8733. d.d.ReadMapElemValue()
  8734. }
  8735. if d.d.TryDecodeAsNil() {
  8736. if v == nil {
  8737. } else if d.h.DeleteOnNilMapValue {
  8738. delete(v, mk)
  8739. } else {
  8740. v[mk] = 0
  8741. }
  8742. continue
  8743. }
  8744. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8745. if v != nil {
  8746. v[mk] = mv
  8747. }
  8748. }
  8749. d.d.ReadMapEnd()
  8750. d.depthDecr()
  8751. return v, changed
  8752. }
  8753. func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  8754. if rv.Kind() == reflect.Ptr {
  8755. vp := rv2i(rv).(*map[uint8]int64)
  8756. v, changed := fastpathTV.DecMapUint8Int64V(*vp, true, d)
  8757. if changed {
  8758. *vp = v
  8759. }
  8760. } else {
  8761. fastpathTV.DecMapUint8Int64V(rv2i(rv).(map[uint8]int64), false, d)
  8762. }
  8763. }
  8764. func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) {
  8765. v, changed := f.DecMapUint8Int64V(*vp, true, d)
  8766. if changed {
  8767. *vp = v
  8768. }
  8769. }
  8770. func (fastpathT) DecMapUint8Int64V(v map[uint8]int64, canChange bool,
  8771. d *Decoder) (_ map[uint8]int64, changed bool) {
  8772. containerLen := d.d.ReadMapStart()
  8773. if canChange && v == nil {
  8774. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8775. v = make(map[uint8]int64, xlen)
  8776. changed = true
  8777. }
  8778. if containerLen == 0 {
  8779. d.d.ReadMapEnd()
  8780. return v, changed
  8781. }
  8782. d.depthIncr()
  8783. var mk uint8
  8784. var mv int64
  8785. hasLen := containerLen > 0
  8786. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8787. if d.esep {
  8788. d.d.ReadMapElemKey()
  8789. }
  8790. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8791. if d.esep {
  8792. d.d.ReadMapElemValue()
  8793. }
  8794. if d.d.TryDecodeAsNil() {
  8795. if v == nil {
  8796. } else if d.h.DeleteOnNilMapValue {
  8797. delete(v, mk)
  8798. } else {
  8799. v[mk] = 0
  8800. }
  8801. continue
  8802. }
  8803. mv = d.d.DecodeInt64()
  8804. if v != nil {
  8805. v[mk] = mv
  8806. }
  8807. }
  8808. d.d.ReadMapEnd()
  8809. d.depthDecr()
  8810. return v, changed
  8811. }
  8812. func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  8813. if rv.Kind() == reflect.Ptr {
  8814. vp := rv2i(rv).(*map[uint8]float32)
  8815. v, changed := fastpathTV.DecMapUint8Float32V(*vp, true, d)
  8816. if changed {
  8817. *vp = v
  8818. }
  8819. } else {
  8820. fastpathTV.DecMapUint8Float32V(rv2i(rv).(map[uint8]float32), false, d)
  8821. }
  8822. }
  8823. func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) {
  8824. v, changed := f.DecMapUint8Float32V(*vp, true, d)
  8825. if changed {
  8826. *vp = v
  8827. }
  8828. }
  8829. func (fastpathT) DecMapUint8Float32V(v map[uint8]float32, canChange bool,
  8830. d *Decoder) (_ map[uint8]float32, changed bool) {
  8831. containerLen := d.d.ReadMapStart()
  8832. if canChange && v == nil {
  8833. xlen := decInferLen(containerLen, d.h.MaxInitLen, 5)
  8834. v = make(map[uint8]float32, xlen)
  8835. changed = true
  8836. }
  8837. if containerLen == 0 {
  8838. d.d.ReadMapEnd()
  8839. return v, changed
  8840. }
  8841. d.depthIncr()
  8842. var mk uint8
  8843. var mv float32
  8844. hasLen := containerLen > 0
  8845. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8846. if d.esep {
  8847. d.d.ReadMapElemKey()
  8848. }
  8849. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8850. if d.esep {
  8851. d.d.ReadMapElemValue()
  8852. }
  8853. if d.d.TryDecodeAsNil() {
  8854. if v == nil {
  8855. } else if d.h.DeleteOnNilMapValue {
  8856. delete(v, mk)
  8857. } else {
  8858. v[mk] = 0
  8859. }
  8860. continue
  8861. }
  8862. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  8863. if v != nil {
  8864. v[mk] = mv
  8865. }
  8866. }
  8867. d.d.ReadMapEnd()
  8868. d.depthDecr()
  8869. return v, changed
  8870. }
  8871. func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  8872. if rv.Kind() == reflect.Ptr {
  8873. vp := rv2i(rv).(*map[uint8]float64)
  8874. v, changed := fastpathTV.DecMapUint8Float64V(*vp, true, d)
  8875. if changed {
  8876. *vp = v
  8877. }
  8878. } else {
  8879. fastpathTV.DecMapUint8Float64V(rv2i(rv).(map[uint8]float64), false, d)
  8880. }
  8881. }
  8882. func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
  8883. v, changed := f.DecMapUint8Float64V(*vp, true, d)
  8884. if changed {
  8885. *vp = v
  8886. }
  8887. }
  8888. func (fastpathT) DecMapUint8Float64V(v map[uint8]float64, canChange bool,
  8889. d *Decoder) (_ map[uint8]float64, changed bool) {
  8890. containerLen := d.d.ReadMapStart()
  8891. if canChange && v == nil {
  8892. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8893. v = make(map[uint8]float64, xlen)
  8894. changed = true
  8895. }
  8896. if containerLen == 0 {
  8897. d.d.ReadMapEnd()
  8898. return v, changed
  8899. }
  8900. d.depthIncr()
  8901. var mk uint8
  8902. var mv float64
  8903. hasLen := containerLen > 0
  8904. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8905. if d.esep {
  8906. d.d.ReadMapElemKey()
  8907. }
  8908. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8909. if d.esep {
  8910. d.d.ReadMapElemValue()
  8911. }
  8912. if d.d.TryDecodeAsNil() {
  8913. if v == nil {
  8914. } else if d.h.DeleteOnNilMapValue {
  8915. delete(v, mk)
  8916. } else {
  8917. v[mk] = 0
  8918. }
  8919. continue
  8920. }
  8921. mv = d.d.DecodeFloat64()
  8922. if v != nil {
  8923. v[mk] = mv
  8924. }
  8925. }
  8926. d.d.ReadMapEnd()
  8927. d.depthDecr()
  8928. return v, changed
  8929. }
  8930. func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  8931. if rv.Kind() == reflect.Ptr {
  8932. vp := rv2i(rv).(*map[uint8]bool)
  8933. v, changed := fastpathTV.DecMapUint8BoolV(*vp, true, d)
  8934. if changed {
  8935. *vp = v
  8936. }
  8937. } else {
  8938. fastpathTV.DecMapUint8BoolV(rv2i(rv).(map[uint8]bool), false, d)
  8939. }
  8940. }
  8941. func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
  8942. v, changed := f.DecMapUint8BoolV(*vp, true, d)
  8943. if changed {
  8944. *vp = v
  8945. }
  8946. }
  8947. func (fastpathT) DecMapUint8BoolV(v map[uint8]bool, canChange bool,
  8948. d *Decoder) (_ map[uint8]bool, changed bool) {
  8949. containerLen := d.d.ReadMapStart()
  8950. if canChange && v == nil {
  8951. xlen := decInferLen(containerLen, d.h.MaxInitLen, 2)
  8952. v = make(map[uint8]bool, xlen)
  8953. changed = true
  8954. }
  8955. if containerLen == 0 {
  8956. d.d.ReadMapEnd()
  8957. return v, changed
  8958. }
  8959. d.depthIncr()
  8960. var mk uint8
  8961. var mv bool
  8962. hasLen := containerLen > 0
  8963. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8964. if d.esep {
  8965. d.d.ReadMapElemKey()
  8966. }
  8967. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8968. if d.esep {
  8969. d.d.ReadMapElemValue()
  8970. }
  8971. if d.d.TryDecodeAsNil() {
  8972. if v == nil {
  8973. } else if d.h.DeleteOnNilMapValue {
  8974. delete(v, mk)
  8975. } else {
  8976. v[mk] = false
  8977. }
  8978. continue
  8979. }
  8980. mv = d.d.DecodeBool()
  8981. if v != nil {
  8982. v[mk] = mv
  8983. }
  8984. }
  8985. d.d.ReadMapEnd()
  8986. d.depthDecr()
  8987. return v, changed
  8988. }
  8989. func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  8990. if rv.Kind() == reflect.Ptr {
  8991. vp := rv2i(rv).(*map[uint64]interface{})
  8992. v, changed := fastpathTV.DecMapUint64IntfV(*vp, true, d)
  8993. if changed {
  8994. *vp = v
  8995. }
  8996. } else {
  8997. fastpathTV.DecMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), false, d)
  8998. }
  8999. }
  9000. func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
  9001. v, changed := f.DecMapUint64IntfV(*vp, true, d)
  9002. if changed {
  9003. *vp = v
  9004. }
  9005. }
  9006. func (fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, canChange bool,
  9007. d *Decoder) (_ map[uint64]interface{}, changed bool) {
  9008. containerLen := d.d.ReadMapStart()
  9009. if canChange && v == nil {
  9010. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9011. v = make(map[uint64]interface{}, xlen)
  9012. changed = true
  9013. }
  9014. if containerLen == 0 {
  9015. d.d.ReadMapEnd()
  9016. return v, changed
  9017. }
  9018. d.depthIncr()
  9019. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  9020. var mk uint64
  9021. var mv interface{}
  9022. hasLen := containerLen > 0
  9023. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9024. if d.esep {
  9025. d.d.ReadMapElemKey()
  9026. }
  9027. mk = d.d.DecodeUint64()
  9028. if d.esep {
  9029. d.d.ReadMapElemValue()
  9030. }
  9031. if d.d.TryDecodeAsNil() {
  9032. if v == nil {
  9033. } else if d.h.DeleteOnNilMapValue {
  9034. delete(v, mk)
  9035. } else {
  9036. v[mk] = nil
  9037. }
  9038. continue
  9039. }
  9040. if mapGet {
  9041. mv = v[mk]
  9042. } else {
  9043. mv = nil
  9044. }
  9045. d.decode(&mv)
  9046. if v != nil {
  9047. v[mk] = mv
  9048. }
  9049. }
  9050. d.d.ReadMapEnd()
  9051. d.depthDecr()
  9052. return v, changed
  9053. }
  9054. func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  9055. if rv.Kind() == reflect.Ptr {
  9056. vp := rv2i(rv).(*map[uint64]string)
  9057. v, changed := fastpathTV.DecMapUint64StringV(*vp, true, d)
  9058. if changed {
  9059. *vp = v
  9060. }
  9061. } else {
  9062. fastpathTV.DecMapUint64StringV(rv2i(rv).(map[uint64]string), false, d)
  9063. }
  9064. }
  9065. func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
  9066. v, changed := f.DecMapUint64StringV(*vp, true, d)
  9067. if changed {
  9068. *vp = v
  9069. }
  9070. }
  9071. func (fastpathT) DecMapUint64StringV(v map[uint64]string, canChange bool,
  9072. d *Decoder) (_ map[uint64]string, changed bool) {
  9073. containerLen := d.d.ReadMapStart()
  9074. if canChange && v == nil {
  9075. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9076. v = make(map[uint64]string, xlen)
  9077. changed = true
  9078. }
  9079. if containerLen == 0 {
  9080. d.d.ReadMapEnd()
  9081. return v, changed
  9082. }
  9083. d.depthIncr()
  9084. var mk uint64
  9085. var mv string
  9086. hasLen := containerLen > 0
  9087. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9088. if d.esep {
  9089. d.d.ReadMapElemKey()
  9090. }
  9091. mk = d.d.DecodeUint64()
  9092. if d.esep {
  9093. d.d.ReadMapElemValue()
  9094. }
  9095. if d.d.TryDecodeAsNil() {
  9096. if v == nil {
  9097. } else if d.h.DeleteOnNilMapValue {
  9098. delete(v, mk)
  9099. } else {
  9100. v[mk] = ""
  9101. }
  9102. continue
  9103. }
  9104. mv = d.d.DecodeString()
  9105. if v != nil {
  9106. v[mk] = mv
  9107. }
  9108. }
  9109. d.d.ReadMapEnd()
  9110. d.depthDecr()
  9111. return v, changed
  9112. }
  9113. func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  9114. if rv.Kind() == reflect.Ptr {
  9115. vp := rv2i(rv).(*map[uint64]uint)
  9116. v, changed := fastpathTV.DecMapUint64UintV(*vp, true, d)
  9117. if changed {
  9118. *vp = v
  9119. }
  9120. } else {
  9121. fastpathTV.DecMapUint64UintV(rv2i(rv).(map[uint64]uint), false, d)
  9122. }
  9123. }
  9124. func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) {
  9125. v, changed := f.DecMapUint64UintV(*vp, true, d)
  9126. if changed {
  9127. *vp = v
  9128. }
  9129. }
  9130. func (fastpathT) DecMapUint64UintV(v map[uint64]uint, canChange bool,
  9131. d *Decoder) (_ map[uint64]uint, changed bool) {
  9132. containerLen := d.d.ReadMapStart()
  9133. if canChange && v == nil {
  9134. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9135. v = make(map[uint64]uint, xlen)
  9136. changed = true
  9137. }
  9138. if containerLen == 0 {
  9139. d.d.ReadMapEnd()
  9140. return v, changed
  9141. }
  9142. d.depthIncr()
  9143. var mk uint64
  9144. var mv uint
  9145. hasLen := containerLen > 0
  9146. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9147. if d.esep {
  9148. d.d.ReadMapElemKey()
  9149. }
  9150. mk = d.d.DecodeUint64()
  9151. if d.esep {
  9152. d.d.ReadMapElemValue()
  9153. }
  9154. if d.d.TryDecodeAsNil() {
  9155. if v == nil {
  9156. } else if d.h.DeleteOnNilMapValue {
  9157. delete(v, mk)
  9158. } else {
  9159. v[mk] = 0
  9160. }
  9161. continue
  9162. }
  9163. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9164. if v != nil {
  9165. v[mk] = mv
  9166. }
  9167. }
  9168. d.d.ReadMapEnd()
  9169. d.depthDecr()
  9170. return v, changed
  9171. }
  9172. func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  9173. if rv.Kind() == reflect.Ptr {
  9174. vp := rv2i(rv).(*map[uint64]uint8)
  9175. v, changed := fastpathTV.DecMapUint64Uint8V(*vp, true, d)
  9176. if changed {
  9177. *vp = v
  9178. }
  9179. } else {
  9180. fastpathTV.DecMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), false, d)
  9181. }
  9182. }
  9183. func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
  9184. v, changed := f.DecMapUint64Uint8V(*vp, true, d)
  9185. if changed {
  9186. *vp = v
  9187. }
  9188. }
  9189. func (fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, canChange bool,
  9190. d *Decoder) (_ map[uint64]uint8, changed bool) {
  9191. containerLen := d.d.ReadMapStart()
  9192. if canChange && v == nil {
  9193. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9194. v = make(map[uint64]uint8, xlen)
  9195. changed = true
  9196. }
  9197. if containerLen == 0 {
  9198. d.d.ReadMapEnd()
  9199. return v, changed
  9200. }
  9201. d.depthIncr()
  9202. var mk uint64
  9203. var mv uint8
  9204. hasLen := containerLen > 0
  9205. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9206. if d.esep {
  9207. d.d.ReadMapElemKey()
  9208. }
  9209. mk = d.d.DecodeUint64()
  9210. if d.esep {
  9211. d.d.ReadMapElemValue()
  9212. }
  9213. if d.d.TryDecodeAsNil() {
  9214. if v == nil {
  9215. } else if d.h.DeleteOnNilMapValue {
  9216. delete(v, mk)
  9217. } else {
  9218. v[mk] = 0
  9219. }
  9220. continue
  9221. }
  9222. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  9223. if v != nil {
  9224. v[mk] = mv
  9225. }
  9226. }
  9227. d.d.ReadMapEnd()
  9228. d.depthDecr()
  9229. return v, changed
  9230. }
  9231. func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  9232. if rv.Kind() == reflect.Ptr {
  9233. vp := rv2i(rv).(*map[uint64]uint64)
  9234. v, changed := fastpathTV.DecMapUint64Uint64V(*vp, true, d)
  9235. if changed {
  9236. *vp = v
  9237. }
  9238. } else {
  9239. fastpathTV.DecMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), false, d)
  9240. }
  9241. }
  9242. func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
  9243. v, changed := f.DecMapUint64Uint64V(*vp, true, d)
  9244. if changed {
  9245. *vp = v
  9246. }
  9247. }
  9248. func (fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, canChange bool,
  9249. d *Decoder) (_ map[uint64]uint64, changed bool) {
  9250. containerLen := d.d.ReadMapStart()
  9251. if canChange && v == nil {
  9252. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9253. v = make(map[uint64]uint64, xlen)
  9254. changed = true
  9255. }
  9256. if containerLen == 0 {
  9257. d.d.ReadMapEnd()
  9258. return v, changed
  9259. }
  9260. d.depthIncr()
  9261. var mk uint64
  9262. var mv uint64
  9263. hasLen := containerLen > 0
  9264. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9265. if d.esep {
  9266. d.d.ReadMapElemKey()
  9267. }
  9268. mk = d.d.DecodeUint64()
  9269. if d.esep {
  9270. d.d.ReadMapElemValue()
  9271. }
  9272. if d.d.TryDecodeAsNil() {
  9273. if v == nil {
  9274. } else if d.h.DeleteOnNilMapValue {
  9275. delete(v, mk)
  9276. } else {
  9277. v[mk] = 0
  9278. }
  9279. continue
  9280. }
  9281. mv = d.d.DecodeUint64()
  9282. if v != nil {
  9283. v[mk] = mv
  9284. }
  9285. }
  9286. d.d.ReadMapEnd()
  9287. d.depthDecr()
  9288. return v, changed
  9289. }
  9290. func (d *Decoder) fastpathDecMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) {
  9291. if rv.Kind() == reflect.Ptr {
  9292. vp := rv2i(rv).(*map[uint64]uintptr)
  9293. v, changed := fastpathTV.DecMapUint64UintptrV(*vp, true, d)
  9294. if changed {
  9295. *vp = v
  9296. }
  9297. } else {
  9298. fastpathTV.DecMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), false, d)
  9299. }
  9300. }
  9301. func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, d *Decoder) {
  9302. v, changed := f.DecMapUint64UintptrV(*vp, true, d)
  9303. if changed {
  9304. *vp = v
  9305. }
  9306. }
  9307. func (fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, canChange bool,
  9308. d *Decoder) (_ map[uint64]uintptr, changed bool) {
  9309. containerLen := d.d.ReadMapStart()
  9310. if canChange && v == nil {
  9311. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9312. v = make(map[uint64]uintptr, xlen)
  9313. changed = true
  9314. }
  9315. if containerLen == 0 {
  9316. d.d.ReadMapEnd()
  9317. return v, changed
  9318. }
  9319. d.depthIncr()
  9320. var mk uint64
  9321. var mv uintptr
  9322. hasLen := containerLen > 0
  9323. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9324. if d.esep {
  9325. d.d.ReadMapElemKey()
  9326. }
  9327. mk = d.d.DecodeUint64()
  9328. if d.esep {
  9329. d.d.ReadMapElemValue()
  9330. }
  9331. if d.d.TryDecodeAsNil() {
  9332. if v == nil {
  9333. } else if d.h.DeleteOnNilMapValue {
  9334. delete(v, mk)
  9335. } else {
  9336. v[mk] = 0
  9337. }
  9338. continue
  9339. }
  9340. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9341. if v != nil {
  9342. v[mk] = mv
  9343. }
  9344. }
  9345. d.d.ReadMapEnd()
  9346. d.depthDecr()
  9347. return v, changed
  9348. }
  9349. func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  9350. if rv.Kind() == reflect.Ptr {
  9351. vp := rv2i(rv).(*map[uint64]int)
  9352. v, changed := fastpathTV.DecMapUint64IntV(*vp, true, d)
  9353. if changed {
  9354. *vp = v
  9355. }
  9356. } else {
  9357. fastpathTV.DecMapUint64IntV(rv2i(rv).(map[uint64]int), false, d)
  9358. }
  9359. }
  9360. func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
  9361. v, changed := f.DecMapUint64IntV(*vp, true, d)
  9362. if changed {
  9363. *vp = v
  9364. }
  9365. }
  9366. func (fastpathT) DecMapUint64IntV(v map[uint64]int, canChange bool,
  9367. d *Decoder) (_ map[uint64]int, changed bool) {
  9368. containerLen := d.d.ReadMapStart()
  9369. if canChange && v == nil {
  9370. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9371. v = make(map[uint64]int, xlen)
  9372. changed = true
  9373. }
  9374. if containerLen == 0 {
  9375. d.d.ReadMapEnd()
  9376. return v, changed
  9377. }
  9378. d.depthIncr()
  9379. var mk uint64
  9380. var mv int
  9381. hasLen := containerLen > 0
  9382. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9383. if d.esep {
  9384. d.d.ReadMapElemKey()
  9385. }
  9386. mk = d.d.DecodeUint64()
  9387. if d.esep {
  9388. d.d.ReadMapElemValue()
  9389. }
  9390. if d.d.TryDecodeAsNil() {
  9391. if v == nil {
  9392. } else if d.h.DeleteOnNilMapValue {
  9393. delete(v, mk)
  9394. } else {
  9395. v[mk] = 0
  9396. }
  9397. continue
  9398. }
  9399. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  9400. if v != nil {
  9401. v[mk] = mv
  9402. }
  9403. }
  9404. d.d.ReadMapEnd()
  9405. d.depthDecr()
  9406. return v, changed
  9407. }
  9408. func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  9409. if rv.Kind() == reflect.Ptr {
  9410. vp := rv2i(rv).(*map[uint64]int64)
  9411. v, changed := fastpathTV.DecMapUint64Int64V(*vp, true, d)
  9412. if changed {
  9413. *vp = v
  9414. }
  9415. } else {
  9416. fastpathTV.DecMapUint64Int64V(rv2i(rv).(map[uint64]int64), false, d)
  9417. }
  9418. }
  9419. func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) {
  9420. v, changed := f.DecMapUint64Int64V(*vp, true, d)
  9421. if changed {
  9422. *vp = v
  9423. }
  9424. }
  9425. func (fastpathT) DecMapUint64Int64V(v map[uint64]int64, canChange bool,
  9426. d *Decoder) (_ map[uint64]int64, changed bool) {
  9427. containerLen := d.d.ReadMapStart()
  9428. if canChange && v == nil {
  9429. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9430. v = make(map[uint64]int64, xlen)
  9431. changed = true
  9432. }
  9433. if containerLen == 0 {
  9434. d.d.ReadMapEnd()
  9435. return v, changed
  9436. }
  9437. d.depthIncr()
  9438. var mk uint64
  9439. var mv int64
  9440. hasLen := containerLen > 0
  9441. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9442. if d.esep {
  9443. d.d.ReadMapElemKey()
  9444. }
  9445. mk = d.d.DecodeUint64()
  9446. if d.esep {
  9447. d.d.ReadMapElemValue()
  9448. }
  9449. if d.d.TryDecodeAsNil() {
  9450. if v == nil {
  9451. } else if d.h.DeleteOnNilMapValue {
  9452. delete(v, mk)
  9453. } else {
  9454. v[mk] = 0
  9455. }
  9456. continue
  9457. }
  9458. mv = d.d.DecodeInt64()
  9459. if v != nil {
  9460. v[mk] = mv
  9461. }
  9462. }
  9463. d.d.ReadMapEnd()
  9464. d.depthDecr()
  9465. return v, changed
  9466. }
  9467. func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  9468. if rv.Kind() == reflect.Ptr {
  9469. vp := rv2i(rv).(*map[uint64]float32)
  9470. v, changed := fastpathTV.DecMapUint64Float32V(*vp, true, d)
  9471. if changed {
  9472. *vp = v
  9473. }
  9474. } else {
  9475. fastpathTV.DecMapUint64Float32V(rv2i(rv).(map[uint64]float32), false, d)
  9476. }
  9477. }
  9478. func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) {
  9479. v, changed := f.DecMapUint64Float32V(*vp, true, d)
  9480. if changed {
  9481. *vp = v
  9482. }
  9483. }
  9484. func (fastpathT) DecMapUint64Float32V(v map[uint64]float32, canChange bool,
  9485. d *Decoder) (_ map[uint64]float32, changed bool) {
  9486. containerLen := d.d.ReadMapStart()
  9487. if canChange && v == nil {
  9488. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  9489. v = make(map[uint64]float32, xlen)
  9490. changed = true
  9491. }
  9492. if containerLen == 0 {
  9493. d.d.ReadMapEnd()
  9494. return v, changed
  9495. }
  9496. d.depthIncr()
  9497. var mk uint64
  9498. var mv float32
  9499. hasLen := containerLen > 0
  9500. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9501. if d.esep {
  9502. d.d.ReadMapElemKey()
  9503. }
  9504. mk = d.d.DecodeUint64()
  9505. if d.esep {
  9506. d.d.ReadMapElemValue()
  9507. }
  9508. if d.d.TryDecodeAsNil() {
  9509. if v == nil {
  9510. } else if d.h.DeleteOnNilMapValue {
  9511. delete(v, mk)
  9512. } else {
  9513. v[mk] = 0
  9514. }
  9515. continue
  9516. }
  9517. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  9518. if v != nil {
  9519. v[mk] = mv
  9520. }
  9521. }
  9522. d.d.ReadMapEnd()
  9523. d.depthDecr()
  9524. return v, changed
  9525. }
  9526. func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  9527. if rv.Kind() == reflect.Ptr {
  9528. vp := rv2i(rv).(*map[uint64]float64)
  9529. v, changed := fastpathTV.DecMapUint64Float64V(*vp, true, d)
  9530. if changed {
  9531. *vp = v
  9532. }
  9533. } else {
  9534. fastpathTV.DecMapUint64Float64V(rv2i(rv).(map[uint64]float64), false, d)
  9535. }
  9536. }
  9537. func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
  9538. v, changed := f.DecMapUint64Float64V(*vp, true, d)
  9539. if changed {
  9540. *vp = v
  9541. }
  9542. }
  9543. func (fastpathT) DecMapUint64Float64V(v map[uint64]float64, canChange bool,
  9544. d *Decoder) (_ map[uint64]float64, changed bool) {
  9545. containerLen := d.d.ReadMapStart()
  9546. if canChange && v == nil {
  9547. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9548. v = make(map[uint64]float64, xlen)
  9549. changed = true
  9550. }
  9551. if containerLen == 0 {
  9552. d.d.ReadMapEnd()
  9553. return v, changed
  9554. }
  9555. d.depthIncr()
  9556. var mk uint64
  9557. var mv float64
  9558. hasLen := containerLen > 0
  9559. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9560. if d.esep {
  9561. d.d.ReadMapElemKey()
  9562. }
  9563. mk = d.d.DecodeUint64()
  9564. if d.esep {
  9565. d.d.ReadMapElemValue()
  9566. }
  9567. if d.d.TryDecodeAsNil() {
  9568. if v == nil {
  9569. } else if d.h.DeleteOnNilMapValue {
  9570. delete(v, mk)
  9571. } else {
  9572. v[mk] = 0
  9573. }
  9574. continue
  9575. }
  9576. mv = d.d.DecodeFloat64()
  9577. if v != nil {
  9578. v[mk] = mv
  9579. }
  9580. }
  9581. d.d.ReadMapEnd()
  9582. d.depthDecr()
  9583. return v, changed
  9584. }
  9585. func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  9586. if rv.Kind() == reflect.Ptr {
  9587. vp := rv2i(rv).(*map[uint64]bool)
  9588. v, changed := fastpathTV.DecMapUint64BoolV(*vp, true, d)
  9589. if changed {
  9590. *vp = v
  9591. }
  9592. } else {
  9593. fastpathTV.DecMapUint64BoolV(rv2i(rv).(map[uint64]bool), false, d)
  9594. }
  9595. }
  9596. func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
  9597. v, changed := f.DecMapUint64BoolV(*vp, true, d)
  9598. if changed {
  9599. *vp = v
  9600. }
  9601. }
  9602. func (fastpathT) DecMapUint64BoolV(v map[uint64]bool, canChange bool,
  9603. d *Decoder) (_ map[uint64]bool, changed bool) {
  9604. containerLen := d.d.ReadMapStart()
  9605. if canChange && v == nil {
  9606. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9607. v = make(map[uint64]bool, xlen)
  9608. changed = true
  9609. }
  9610. if containerLen == 0 {
  9611. d.d.ReadMapEnd()
  9612. return v, changed
  9613. }
  9614. d.depthIncr()
  9615. var mk uint64
  9616. var mv bool
  9617. hasLen := containerLen > 0
  9618. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9619. if d.esep {
  9620. d.d.ReadMapElemKey()
  9621. }
  9622. mk = d.d.DecodeUint64()
  9623. if d.esep {
  9624. d.d.ReadMapElemValue()
  9625. }
  9626. if d.d.TryDecodeAsNil() {
  9627. if v == nil {
  9628. } else if d.h.DeleteOnNilMapValue {
  9629. delete(v, mk)
  9630. } else {
  9631. v[mk] = false
  9632. }
  9633. continue
  9634. }
  9635. mv = d.d.DecodeBool()
  9636. if v != nil {
  9637. v[mk] = mv
  9638. }
  9639. }
  9640. d.d.ReadMapEnd()
  9641. d.depthDecr()
  9642. return v, changed
  9643. }
  9644. func (d *Decoder) fastpathDecMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) {
  9645. if rv.Kind() == reflect.Ptr {
  9646. vp := rv2i(rv).(*map[uintptr]interface{})
  9647. v, changed := fastpathTV.DecMapUintptrIntfV(*vp, true, d)
  9648. if changed {
  9649. *vp = v
  9650. }
  9651. } else {
  9652. fastpathTV.DecMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), false, d)
  9653. }
  9654. }
  9655. func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, d *Decoder) {
  9656. v, changed := f.DecMapUintptrIntfV(*vp, true, d)
  9657. if changed {
  9658. *vp = v
  9659. }
  9660. }
  9661. func (fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, canChange bool,
  9662. d *Decoder) (_ map[uintptr]interface{}, changed bool) {
  9663. containerLen := d.d.ReadMapStart()
  9664. if canChange && v == nil {
  9665. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9666. v = make(map[uintptr]interface{}, xlen)
  9667. changed = true
  9668. }
  9669. if containerLen == 0 {
  9670. d.d.ReadMapEnd()
  9671. return v, changed
  9672. }
  9673. d.depthIncr()
  9674. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  9675. var mk uintptr
  9676. var mv interface{}
  9677. hasLen := containerLen > 0
  9678. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9679. if d.esep {
  9680. d.d.ReadMapElemKey()
  9681. }
  9682. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9683. if d.esep {
  9684. d.d.ReadMapElemValue()
  9685. }
  9686. if d.d.TryDecodeAsNil() {
  9687. if v == nil {
  9688. } else if d.h.DeleteOnNilMapValue {
  9689. delete(v, mk)
  9690. } else {
  9691. v[mk] = nil
  9692. }
  9693. continue
  9694. }
  9695. if mapGet {
  9696. mv = v[mk]
  9697. } else {
  9698. mv = nil
  9699. }
  9700. d.decode(&mv)
  9701. if v != nil {
  9702. v[mk] = mv
  9703. }
  9704. }
  9705. d.d.ReadMapEnd()
  9706. d.depthDecr()
  9707. return v, changed
  9708. }
  9709. func (d *Decoder) fastpathDecMapUintptrStringR(f *codecFnInfo, rv reflect.Value) {
  9710. if rv.Kind() == reflect.Ptr {
  9711. vp := rv2i(rv).(*map[uintptr]string)
  9712. v, changed := fastpathTV.DecMapUintptrStringV(*vp, true, d)
  9713. if changed {
  9714. *vp = v
  9715. }
  9716. } else {
  9717. fastpathTV.DecMapUintptrStringV(rv2i(rv).(map[uintptr]string), false, d)
  9718. }
  9719. }
  9720. func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, d *Decoder) {
  9721. v, changed := f.DecMapUintptrStringV(*vp, true, d)
  9722. if changed {
  9723. *vp = v
  9724. }
  9725. }
  9726. func (fastpathT) DecMapUintptrStringV(v map[uintptr]string, canChange bool,
  9727. d *Decoder) (_ map[uintptr]string, changed bool) {
  9728. containerLen := d.d.ReadMapStart()
  9729. if canChange && v == nil {
  9730. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9731. v = make(map[uintptr]string, xlen)
  9732. changed = true
  9733. }
  9734. if containerLen == 0 {
  9735. d.d.ReadMapEnd()
  9736. return v, changed
  9737. }
  9738. d.depthIncr()
  9739. var mk uintptr
  9740. var mv string
  9741. hasLen := containerLen > 0
  9742. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9743. if d.esep {
  9744. d.d.ReadMapElemKey()
  9745. }
  9746. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9747. if d.esep {
  9748. d.d.ReadMapElemValue()
  9749. }
  9750. if d.d.TryDecodeAsNil() {
  9751. if v == nil {
  9752. } else if d.h.DeleteOnNilMapValue {
  9753. delete(v, mk)
  9754. } else {
  9755. v[mk] = ""
  9756. }
  9757. continue
  9758. }
  9759. mv = d.d.DecodeString()
  9760. if v != nil {
  9761. v[mk] = mv
  9762. }
  9763. }
  9764. d.d.ReadMapEnd()
  9765. d.depthDecr()
  9766. return v, changed
  9767. }
  9768. func (d *Decoder) fastpathDecMapUintptrUintR(f *codecFnInfo, rv reflect.Value) {
  9769. if rv.Kind() == reflect.Ptr {
  9770. vp := rv2i(rv).(*map[uintptr]uint)
  9771. v, changed := fastpathTV.DecMapUintptrUintV(*vp, true, d)
  9772. if changed {
  9773. *vp = v
  9774. }
  9775. } else {
  9776. fastpathTV.DecMapUintptrUintV(rv2i(rv).(map[uintptr]uint), false, d)
  9777. }
  9778. }
  9779. func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, d *Decoder) {
  9780. v, changed := f.DecMapUintptrUintV(*vp, true, d)
  9781. if changed {
  9782. *vp = v
  9783. }
  9784. }
  9785. func (fastpathT) DecMapUintptrUintV(v map[uintptr]uint, canChange bool,
  9786. d *Decoder) (_ map[uintptr]uint, changed bool) {
  9787. containerLen := d.d.ReadMapStart()
  9788. if canChange && v == nil {
  9789. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9790. v = make(map[uintptr]uint, xlen)
  9791. changed = true
  9792. }
  9793. if containerLen == 0 {
  9794. d.d.ReadMapEnd()
  9795. return v, changed
  9796. }
  9797. d.depthIncr()
  9798. var mk uintptr
  9799. var mv uint
  9800. hasLen := containerLen > 0
  9801. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9802. if d.esep {
  9803. d.d.ReadMapElemKey()
  9804. }
  9805. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9806. if d.esep {
  9807. d.d.ReadMapElemValue()
  9808. }
  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 = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9819. if v != nil {
  9820. v[mk] = mv
  9821. }
  9822. }
  9823. d.d.ReadMapEnd()
  9824. d.depthDecr()
  9825. return v, changed
  9826. }
  9827. func (d *Decoder) fastpathDecMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) {
  9828. if rv.Kind() == reflect.Ptr {
  9829. vp := rv2i(rv).(*map[uintptr]uint8)
  9830. v, changed := fastpathTV.DecMapUintptrUint8V(*vp, true, d)
  9831. if changed {
  9832. *vp = v
  9833. }
  9834. } else {
  9835. fastpathTV.DecMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), false, d)
  9836. }
  9837. }
  9838. func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, d *Decoder) {
  9839. v, changed := f.DecMapUintptrUint8V(*vp, true, d)
  9840. if changed {
  9841. *vp = v
  9842. }
  9843. }
  9844. func (fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, canChange bool,
  9845. d *Decoder) (_ map[uintptr]uint8, changed bool) {
  9846. containerLen := d.d.ReadMapStart()
  9847. if canChange && v == nil {
  9848. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9849. v = make(map[uintptr]uint8, xlen)
  9850. changed = true
  9851. }
  9852. if containerLen == 0 {
  9853. d.d.ReadMapEnd()
  9854. return v, changed
  9855. }
  9856. d.depthIncr()
  9857. var mk uintptr
  9858. var mv uint8
  9859. hasLen := containerLen > 0
  9860. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9861. if d.esep {
  9862. d.d.ReadMapElemKey()
  9863. }
  9864. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9865. if d.esep {
  9866. d.d.ReadMapElemValue()
  9867. }
  9868. if d.d.TryDecodeAsNil() {
  9869. if v == nil {
  9870. } else if d.h.DeleteOnNilMapValue {
  9871. delete(v, mk)
  9872. } else {
  9873. v[mk] = 0
  9874. }
  9875. continue
  9876. }
  9877. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  9878. if v != nil {
  9879. v[mk] = mv
  9880. }
  9881. }
  9882. d.d.ReadMapEnd()
  9883. d.depthDecr()
  9884. return v, changed
  9885. }
  9886. func (d *Decoder) fastpathDecMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) {
  9887. if rv.Kind() == reflect.Ptr {
  9888. vp := rv2i(rv).(*map[uintptr]uint64)
  9889. v, changed := fastpathTV.DecMapUintptrUint64V(*vp, true, d)
  9890. if changed {
  9891. *vp = v
  9892. }
  9893. } else {
  9894. fastpathTV.DecMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), false, d)
  9895. }
  9896. }
  9897. func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, d *Decoder) {
  9898. v, changed := f.DecMapUintptrUint64V(*vp, true, d)
  9899. if changed {
  9900. *vp = v
  9901. }
  9902. }
  9903. func (fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, canChange bool,
  9904. d *Decoder) (_ map[uintptr]uint64, changed bool) {
  9905. containerLen := d.d.ReadMapStart()
  9906. if canChange && v == nil {
  9907. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9908. v = make(map[uintptr]uint64, xlen)
  9909. changed = true
  9910. }
  9911. if containerLen == 0 {
  9912. d.d.ReadMapEnd()
  9913. return v, changed
  9914. }
  9915. d.depthIncr()
  9916. var mk uintptr
  9917. var mv uint64
  9918. hasLen := containerLen > 0
  9919. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9920. if d.esep {
  9921. d.d.ReadMapElemKey()
  9922. }
  9923. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9924. if d.esep {
  9925. d.d.ReadMapElemValue()
  9926. }
  9927. if d.d.TryDecodeAsNil() {
  9928. if v == nil {
  9929. } else if d.h.DeleteOnNilMapValue {
  9930. delete(v, mk)
  9931. } else {
  9932. v[mk] = 0
  9933. }
  9934. continue
  9935. }
  9936. mv = d.d.DecodeUint64()
  9937. if v != nil {
  9938. v[mk] = mv
  9939. }
  9940. }
  9941. d.d.ReadMapEnd()
  9942. d.depthDecr()
  9943. return v, changed
  9944. }
  9945. func (d *Decoder) fastpathDecMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) {
  9946. if rv.Kind() == reflect.Ptr {
  9947. vp := rv2i(rv).(*map[uintptr]uintptr)
  9948. v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, true, d)
  9949. if changed {
  9950. *vp = v
  9951. }
  9952. } else {
  9953. fastpathTV.DecMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), false, d)
  9954. }
  9955. }
  9956. func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, d *Decoder) {
  9957. v, changed := f.DecMapUintptrUintptrV(*vp, true, d)
  9958. if changed {
  9959. *vp = v
  9960. }
  9961. }
  9962. func (fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, canChange bool,
  9963. d *Decoder) (_ map[uintptr]uintptr, changed bool) {
  9964. containerLen := d.d.ReadMapStart()
  9965. if canChange && v == nil {
  9966. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9967. v = make(map[uintptr]uintptr, xlen)
  9968. changed = true
  9969. }
  9970. if containerLen == 0 {
  9971. d.d.ReadMapEnd()
  9972. return v, changed
  9973. }
  9974. d.depthIncr()
  9975. var mk uintptr
  9976. var mv uintptr
  9977. hasLen := containerLen > 0
  9978. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9979. if d.esep {
  9980. d.d.ReadMapElemKey()
  9981. }
  9982. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9983. if d.esep {
  9984. d.d.ReadMapElemValue()
  9985. }
  9986. if d.d.TryDecodeAsNil() {
  9987. if v == nil {
  9988. } else if d.h.DeleteOnNilMapValue {
  9989. delete(v, mk)
  9990. } else {
  9991. v[mk] = 0
  9992. }
  9993. continue
  9994. }
  9995. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  9996. if v != nil {
  9997. v[mk] = mv
  9998. }
  9999. }
  10000. d.d.ReadMapEnd()
  10001. d.depthDecr()
  10002. return v, changed
  10003. }
  10004. func (d *Decoder) fastpathDecMapUintptrIntR(f *codecFnInfo, rv reflect.Value) {
  10005. if rv.Kind() == reflect.Ptr {
  10006. vp := rv2i(rv).(*map[uintptr]int)
  10007. v, changed := fastpathTV.DecMapUintptrIntV(*vp, true, d)
  10008. if changed {
  10009. *vp = v
  10010. }
  10011. } else {
  10012. fastpathTV.DecMapUintptrIntV(rv2i(rv).(map[uintptr]int), false, d)
  10013. }
  10014. }
  10015. func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, d *Decoder) {
  10016. v, changed := f.DecMapUintptrIntV(*vp, true, d)
  10017. if changed {
  10018. *vp = v
  10019. }
  10020. }
  10021. func (fastpathT) DecMapUintptrIntV(v map[uintptr]int, canChange bool,
  10022. d *Decoder) (_ map[uintptr]int, changed bool) {
  10023. containerLen := d.d.ReadMapStart()
  10024. if canChange && v == nil {
  10025. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10026. v = make(map[uintptr]int, xlen)
  10027. changed = true
  10028. }
  10029. if containerLen == 0 {
  10030. d.d.ReadMapEnd()
  10031. return v, changed
  10032. }
  10033. d.depthIncr()
  10034. var mk uintptr
  10035. var mv int
  10036. hasLen := containerLen > 0
  10037. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10038. if d.esep {
  10039. d.d.ReadMapElemKey()
  10040. }
  10041. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10042. if d.esep {
  10043. d.d.ReadMapElemValue()
  10044. }
  10045. if d.d.TryDecodeAsNil() {
  10046. if v == nil {
  10047. } else if d.h.DeleteOnNilMapValue {
  10048. delete(v, mk)
  10049. } else {
  10050. v[mk] = 0
  10051. }
  10052. continue
  10053. }
  10054. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10055. if v != nil {
  10056. v[mk] = mv
  10057. }
  10058. }
  10059. d.d.ReadMapEnd()
  10060. d.depthDecr()
  10061. return v, changed
  10062. }
  10063. func (d *Decoder) fastpathDecMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) {
  10064. if rv.Kind() == reflect.Ptr {
  10065. vp := rv2i(rv).(*map[uintptr]int64)
  10066. v, changed := fastpathTV.DecMapUintptrInt64V(*vp, true, d)
  10067. if changed {
  10068. *vp = v
  10069. }
  10070. } else {
  10071. fastpathTV.DecMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), false, d)
  10072. }
  10073. }
  10074. func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, d *Decoder) {
  10075. v, changed := f.DecMapUintptrInt64V(*vp, true, d)
  10076. if changed {
  10077. *vp = v
  10078. }
  10079. }
  10080. func (fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, canChange bool,
  10081. d *Decoder) (_ map[uintptr]int64, changed bool) {
  10082. containerLen := d.d.ReadMapStart()
  10083. if canChange && v == nil {
  10084. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10085. v = make(map[uintptr]int64, xlen)
  10086. changed = true
  10087. }
  10088. if containerLen == 0 {
  10089. d.d.ReadMapEnd()
  10090. return v, changed
  10091. }
  10092. d.depthIncr()
  10093. var mk uintptr
  10094. var mv int64
  10095. hasLen := containerLen > 0
  10096. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10097. if d.esep {
  10098. d.d.ReadMapElemKey()
  10099. }
  10100. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10101. if d.esep {
  10102. d.d.ReadMapElemValue()
  10103. }
  10104. if d.d.TryDecodeAsNil() {
  10105. if v == nil {
  10106. } else if d.h.DeleteOnNilMapValue {
  10107. delete(v, mk)
  10108. } else {
  10109. v[mk] = 0
  10110. }
  10111. continue
  10112. }
  10113. mv = d.d.DecodeInt64()
  10114. if v != nil {
  10115. v[mk] = mv
  10116. }
  10117. }
  10118. d.d.ReadMapEnd()
  10119. d.depthDecr()
  10120. return v, changed
  10121. }
  10122. func (d *Decoder) fastpathDecMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) {
  10123. if rv.Kind() == reflect.Ptr {
  10124. vp := rv2i(rv).(*map[uintptr]float32)
  10125. v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, true, d)
  10126. if changed {
  10127. *vp = v
  10128. }
  10129. } else {
  10130. fastpathTV.DecMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), false, d)
  10131. }
  10132. }
  10133. func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, d *Decoder) {
  10134. v, changed := f.DecMapUintptrFloat32V(*vp, true, d)
  10135. if changed {
  10136. *vp = v
  10137. }
  10138. }
  10139. func (fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, canChange bool,
  10140. d *Decoder) (_ map[uintptr]float32, changed bool) {
  10141. containerLen := d.d.ReadMapStart()
  10142. if canChange && v == nil {
  10143. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  10144. v = make(map[uintptr]float32, xlen)
  10145. changed = true
  10146. }
  10147. if containerLen == 0 {
  10148. d.d.ReadMapEnd()
  10149. return v, changed
  10150. }
  10151. d.depthIncr()
  10152. var mk uintptr
  10153. var mv float32
  10154. hasLen := containerLen > 0
  10155. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10156. if d.esep {
  10157. d.d.ReadMapElemKey()
  10158. }
  10159. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10160. if d.esep {
  10161. d.d.ReadMapElemValue()
  10162. }
  10163. if d.d.TryDecodeAsNil() {
  10164. if v == nil {
  10165. } else if d.h.DeleteOnNilMapValue {
  10166. delete(v, mk)
  10167. } else {
  10168. v[mk] = 0
  10169. }
  10170. continue
  10171. }
  10172. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  10173. if v != nil {
  10174. v[mk] = mv
  10175. }
  10176. }
  10177. d.d.ReadMapEnd()
  10178. d.depthDecr()
  10179. return v, changed
  10180. }
  10181. func (d *Decoder) fastpathDecMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) {
  10182. if rv.Kind() == reflect.Ptr {
  10183. vp := rv2i(rv).(*map[uintptr]float64)
  10184. v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, true, d)
  10185. if changed {
  10186. *vp = v
  10187. }
  10188. } else {
  10189. fastpathTV.DecMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), false, d)
  10190. }
  10191. }
  10192. func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, d *Decoder) {
  10193. v, changed := f.DecMapUintptrFloat64V(*vp, true, d)
  10194. if changed {
  10195. *vp = v
  10196. }
  10197. }
  10198. func (fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, canChange bool,
  10199. d *Decoder) (_ map[uintptr]float64, changed bool) {
  10200. containerLen := d.d.ReadMapStart()
  10201. if canChange && v == nil {
  10202. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10203. v = make(map[uintptr]float64, xlen)
  10204. changed = true
  10205. }
  10206. if containerLen == 0 {
  10207. d.d.ReadMapEnd()
  10208. return v, changed
  10209. }
  10210. d.depthIncr()
  10211. var mk uintptr
  10212. var mv float64
  10213. hasLen := containerLen > 0
  10214. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10215. if d.esep {
  10216. d.d.ReadMapElemKey()
  10217. }
  10218. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10219. if d.esep {
  10220. d.d.ReadMapElemValue()
  10221. }
  10222. if d.d.TryDecodeAsNil() {
  10223. if v == nil {
  10224. } else if d.h.DeleteOnNilMapValue {
  10225. delete(v, mk)
  10226. } else {
  10227. v[mk] = 0
  10228. }
  10229. continue
  10230. }
  10231. mv = d.d.DecodeFloat64()
  10232. if v != nil {
  10233. v[mk] = mv
  10234. }
  10235. }
  10236. d.d.ReadMapEnd()
  10237. d.depthDecr()
  10238. return v, changed
  10239. }
  10240. func (d *Decoder) fastpathDecMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) {
  10241. if rv.Kind() == reflect.Ptr {
  10242. vp := rv2i(rv).(*map[uintptr]bool)
  10243. v, changed := fastpathTV.DecMapUintptrBoolV(*vp, true, d)
  10244. if changed {
  10245. *vp = v
  10246. }
  10247. } else {
  10248. fastpathTV.DecMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), false, d)
  10249. }
  10250. }
  10251. func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, d *Decoder) {
  10252. v, changed := f.DecMapUintptrBoolV(*vp, true, d)
  10253. if changed {
  10254. *vp = v
  10255. }
  10256. }
  10257. func (fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, canChange bool,
  10258. d *Decoder) (_ map[uintptr]bool, changed bool) {
  10259. containerLen := d.d.ReadMapStart()
  10260. if canChange && v == nil {
  10261. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10262. v = make(map[uintptr]bool, xlen)
  10263. changed = true
  10264. }
  10265. if containerLen == 0 {
  10266. d.d.ReadMapEnd()
  10267. return v, changed
  10268. }
  10269. d.depthIncr()
  10270. var mk uintptr
  10271. var mv bool
  10272. hasLen := containerLen > 0
  10273. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10274. if d.esep {
  10275. d.d.ReadMapElemKey()
  10276. }
  10277. mk = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10278. if d.esep {
  10279. d.d.ReadMapElemValue()
  10280. }
  10281. if d.d.TryDecodeAsNil() {
  10282. if v == nil {
  10283. } else if d.h.DeleteOnNilMapValue {
  10284. delete(v, mk)
  10285. } else {
  10286. v[mk] = false
  10287. }
  10288. continue
  10289. }
  10290. mv = d.d.DecodeBool()
  10291. if v != nil {
  10292. v[mk] = mv
  10293. }
  10294. }
  10295. d.d.ReadMapEnd()
  10296. d.depthDecr()
  10297. return v, changed
  10298. }
  10299. func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  10300. if rv.Kind() == reflect.Ptr {
  10301. vp := rv2i(rv).(*map[int]interface{})
  10302. v, changed := fastpathTV.DecMapIntIntfV(*vp, true, d)
  10303. if changed {
  10304. *vp = v
  10305. }
  10306. } else {
  10307. fastpathTV.DecMapIntIntfV(rv2i(rv).(map[int]interface{}), false, d)
  10308. }
  10309. }
  10310. func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
  10311. v, changed := f.DecMapIntIntfV(*vp, true, d)
  10312. if changed {
  10313. *vp = v
  10314. }
  10315. }
  10316. func (fastpathT) DecMapIntIntfV(v map[int]interface{}, canChange bool,
  10317. d *Decoder) (_ map[int]interface{}, changed bool) {
  10318. containerLen := d.d.ReadMapStart()
  10319. if canChange && v == nil {
  10320. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  10321. v = make(map[int]interface{}, xlen)
  10322. changed = true
  10323. }
  10324. if containerLen == 0 {
  10325. d.d.ReadMapEnd()
  10326. return v, changed
  10327. }
  10328. d.depthIncr()
  10329. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  10330. var mk int
  10331. var mv interface{}
  10332. hasLen := containerLen > 0
  10333. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10334. if d.esep {
  10335. d.d.ReadMapElemKey()
  10336. }
  10337. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10338. if d.esep {
  10339. d.d.ReadMapElemValue()
  10340. }
  10341. if d.d.TryDecodeAsNil() {
  10342. if v == nil {
  10343. } else if d.h.DeleteOnNilMapValue {
  10344. delete(v, mk)
  10345. } else {
  10346. v[mk] = nil
  10347. }
  10348. continue
  10349. }
  10350. if mapGet {
  10351. mv = v[mk]
  10352. } else {
  10353. mv = nil
  10354. }
  10355. d.decode(&mv)
  10356. if v != nil {
  10357. v[mk] = mv
  10358. }
  10359. }
  10360. d.d.ReadMapEnd()
  10361. d.depthDecr()
  10362. return v, changed
  10363. }
  10364. func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  10365. if rv.Kind() == reflect.Ptr {
  10366. vp := rv2i(rv).(*map[int]string)
  10367. v, changed := fastpathTV.DecMapIntStringV(*vp, true, d)
  10368. if changed {
  10369. *vp = v
  10370. }
  10371. } else {
  10372. fastpathTV.DecMapIntStringV(rv2i(rv).(map[int]string), false, d)
  10373. }
  10374. }
  10375. func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
  10376. v, changed := f.DecMapIntStringV(*vp, true, d)
  10377. if changed {
  10378. *vp = v
  10379. }
  10380. }
  10381. func (fastpathT) DecMapIntStringV(v map[int]string, canChange bool,
  10382. d *Decoder) (_ map[int]string, changed bool) {
  10383. containerLen := d.d.ReadMapStart()
  10384. if canChange && v == nil {
  10385. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  10386. v = make(map[int]string, xlen)
  10387. changed = true
  10388. }
  10389. if containerLen == 0 {
  10390. d.d.ReadMapEnd()
  10391. return v, changed
  10392. }
  10393. d.depthIncr()
  10394. var mk int
  10395. var mv string
  10396. hasLen := containerLen > 0
  10397. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10398. if d.esep {
  10399. d.d.ReadMapElemKey()
  10400. }
  10401. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10402. if d.esep {
  10403. d.d.ReadMapElemValue()
  10404. }
  10405. if d.d.TryDecodeAsNil() {
  10406. if v == nil {
  10407. } else if d.h.DeleteOnNilMapValue {
  10408. delete(v, mk)
  10409. } else {
  10410. v[mk] = ""
  10411. }
  10412. continue
  10413. }
  10414. mv = d.d.DecodeString()
  10415. if v != nil {
  10416. v[mk] = mv
  10417. }
  10418. }
  10419. d.d.ReadMapEnd()
  10420. d.depthDecr()
  10421. return v, changed
  10422. }
  10423. func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  10424. if rv.Kind() == reflect.Ptr {
  10425. vp := rv2i(rv).(*map[int]uint)
  10426. v, changed := fastpathTV.DecMapIntUintV(*vp, true, d)
  10427. if changed {
  10428. *vp = v
  10429. }
  10430. } else {
  10431. fastpathTV.DecMapIntUintV(rv2i(rv).(map[int]uint), false, d)
  10432. }
  10433. }
  10434. func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) {
  10435. v, changed := f.DecMapIntUintV(*vp, true, d)
  10436. if changed {
  10437. *vp = v
  10438. }
  10439. }
  10440. func (fastpathT) DecMapIntUintV(v map[int]uint, canChange bool,
  10441. d *Decoder) (_ map[int]uint, changed bool) {
  10442. containerLen := d.d.ReadMapStart()
  10443. if canChange && v == nil {
  10444. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10445. v = make(map[int]uint, xlen)
  10446. changed = true
  10447. }
  10448. if containerLen == 0 {
  10449. d.d.ReadMapEnd()
  10450. return v, changed
  10451. }
  10452. d.depthIncr()
  10453. var mk int
  10454. var mv uint
  10455. hasLen := containerLen > 0
  10456. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10457. if d.esep {
  10458. d.d.ReadMapElemKey()
  10459. }
  10460. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10461. if d.esep {
  10462. d.d.ReadMapElemValue()
  10463. }
  10464. if d.d.TryDecodeAsNil() {
  10465. if v == nil {
  10466. } else if d.h.DeleteOnNilMapValue {
  10467. delete(v, mk)
  10468. } else {
  10469. v[mk] = 0
  10470. }
  10471. continue
  10472. }
  10473. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10474. if v != nil {
  10475. v[mk] = mv
  10476. }
  10477. }
  10478. d.d.ReadMapEnd()
  10479. d.depthDecr()
  10480. return v, changed
  10481. }
  10482. func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  10483. if rv.Kind() == reflect.Ptr {
  10484. vp := rv2i(rv).(*map[int]uint8)
  10485. v, changed := fastpathTV.DecMapIntUint8V(*vp, true, d)
  10486. if changed {
  10487. *vp = v
  10488. }
  10489. } else {
  10490. fastpathTV.DecMapIntUint8V(rv2i(rv).(map[int]uint8), false, d)
  10491. }
  10492. }
  10493. func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
  10494. v, changed := f.DecMapIntUint8V(*vp, true, d)
  10495. if changed {
  10496. *vp = v
  10497. }
  10498. }
  10499. func (fastpathT) DecMapIntUint8V(v map[int]uint8, canChange bool,
  10500. d *Decoder) (_ map[int]uint8, changed bool) {
  10501. containerLen := d.d.ReadMapStart()
  10502. if canChange && v == nil {
  10503. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10504. v = make(map[int]uint8, xlen)
  10505. changed = true
  10506. }
  10507. if containerLen == 0 {
  10508. d.d.ReadMapEnd()
  10509. return v, changed
  10510. }
  10511. d.depthIncr()
  10512. var mk int
  10513. var mv uint8
  10514. hasLen := containerLen > 0
  10515. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10516. if d.esep {
  10517. d.d.ReadMapElemKey()
  10518. }
  10519. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10520. if d.esep {
  10521. d.d.ReadMapElemValue()
  10522. }
  10523. if d.d.TryDecodeAsNil() {
  10524. if v == nil {
  10525. } else if d.h.DeleteOnNilMapValue {
  10526. delete(v, mk)
  10527. } else {
  10528. v[mk] = 0
  10529. }
  10530. continue
  10531. }
  10532. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  10533. if v != nil {
  10534. v[mk] = mv
  10535. }
  10536. }
  10537. d.d.ReadMapEnd()
  10538. d.depthDecr()
  10539. return v, changed
  10540. }
  10541. func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  10542. if rv.Kind() == reflect.Ptr {
  10543. vp := rv2i(rv).(*map[int]uint64)
  10544. v, changed := fastpathTV.DecMapIntUint64V(*vp, true, d)
  10545. if changed {
  10546. *vp = v
  10547. }
  10548. } else {
  10549. fastpathTV.DecMapIntUint64V(rv2i(rv).(map[int]uint64), false, d)
  10550. }
  10551. }
  10552. func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
  10553. v, changed := f.DecMapIntUint64V(*vp, true, d)
  10554. if changed {
  10555. *vp = v
  10556. }
  10557. }
  10558. func (fastpathT) DecMapIntUint64V(v map[int]uint64, canChange bool,
  10559. d *Decoder) (_ map[int]uint64, changed bool) {
  10560. containerLen := d.d.ReadMapStart()
  10561. if canChange && v == nil {
  10562. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10563. v = make(map[int]uint64, xlen)
  10564. changed = true
  10565. }
  10566. if containerLen == 0 {
  10567. d.d.ReadMapEnd()
  10568. return v, changed
  10569. }
  10570. d.depthIncr()
  10571. var mk int
  10572. var mv uint64
  10573. hasLen := containerLen > 0
  10574. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10575. if d.esep {
  10576. d.d.ReadMapElemKey()
  10577. }
  10578. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10579. if d.esep {
  10580. d.d.ReadMapElemValue()
  10581. }
  10582. if d.d.TryDecodeAsNil() {
  10583. if v == nil {
  10584. } else if d.h.DeleteOnNilMapValue {
  10585. delete(v, mk)
  10586. } else {
  10587. v[mk] = 0
  10588. }
  10589. continue
  10590. }
  10591. mv = d.d.DecodeUint64()
  10592. if v != nil {
  10593. v[mk] = mv
  10594. }
  10595. }
  10596. d.d.ReadMapEnd()
  10597. d.depthDecr()
  10598. return v, changed
  10599. }
  10600. func (d *Decoder) fastpathDecMapIntUintptrR(f *codecFnInfo, rv reflect.Value) {
  10601. if rv.Kind() == reflect.Ptr {
  10602. vp := rv2i(rv).(*map[int]uintptr)
  10603. v, changed := fastpathTV.DecMapIntUintptrV(*vp, true, d)
  10604. if changed {
  10605. *vp = v
  10606. }
  10607. } else {
  10608. fastpathTV.DecMapIntUintptrV(rv2i(rv).(map[int]uintptr), false, d)
  10609. }
  10610. }
  10611. func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, d *Decoder) {
  10612. v, changed := f.DecMapIntUintptrV(*vp, true, d)
  10613. if changed {
  10614. *vp = v
  10615. }
  10616. }
  10617. func (fastpathT) DecMapIntUintptrV(v map[int]uintptr, canChange bool,
  10618. d *Decoder) (_ map[int]uintptr, changed bool) {
  10619. containerLen := d.d.ReadMapStart()
  10620. if canChange && v == nil {
  10621. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10622. v = make(map[int]uintptr, xlen)
  10623. changed = true
  10624. }
  10625. if containerLen == 0 {
  10626. d.d.ReadMapEnd()
  10627. return v, changed
  10628. }
  10629. d.depthIncr()
  10630. var mk int
  10631. var mv uintptr
  10632. hasLen := containerLen > 0
  10633. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10634. if d.esep {
  10635. d.d.ReadMapElemKey()
  10636. }
  10637. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10638. if d.esep {
  10639. d.d.ReadMapElemValue()
  10640. }
  10641. if d.d.TryDecodeAsNil() {
  10642. if v == nil {
  10643. } else if d.h.DeleteOnNilMapValue {
  10644. delete(v, mk)
  10645. } else {
  10646. v[mk] = 0
  10647. }
  10648. continue
  10649. }
  10650. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  10651. if v != nil {
  10652. v[mk] = mv
  10653. }
  10654. }
  10655. d.d.ReadMapEnd()
  10656. d.depthDecr()
  10657. return v, changed
  10658. }
  10659. func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  10660. if rv.Kind() == reflect.Ptr {
  10661. vp := rv2i(rv).(*map[int]int)
  10662. v, changed := fastpathTV.DecMapIntIntV(*vp, true, d)
  10663. if changed {
  10664. *vp = v
  10665. }
  10666. } else {
  10667. fastpathTV.DecMapIntIntV(rv2i(rv).(map[int]int), false, d)
  10668. }
  10669. }
  10670. func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
  10671. v, changed := f.DecMapIntIntV(*vp, true, d)
  10672. if changed {
  10673. *vp = v
  10674. }
  10675. }
  10676. func (fastpathT) DecMapIntIntV(v map[int]int, canChange bool,
  10677. d *Decoder) (_ map[int]int, changed bool) {
  10678. containerLen := d.d.ReadMapStart()
  10679. if canChange && v == nil {
  10680. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10681. v = make(map[int]int, xlen)
  10682. changed = true
  10683. }
  10684. if containerLen == 0 {
  10685. d.d.ReadMapEnd()
  10686. return v, changed
  10687. }
  10688. d.depthIncr()
  10689. var mk int
  10690. var mv int
  10691. hasLen := containerLen > 0
  10692. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10693. if d.esep {
  10694. d.d.ReadMapElemKey()
  10695. }
  10696. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10697. if d.esep {
  10698. d.d.ReadMapElemValue()
  10699. }
  10700. if d.d.TryDecodeAsNil() {
  10701. if v == nil {
  10702. } else if d.h.DeleteOnNilMapValue {
  10703. delete(v, mk)
  10704. } else {
  10705. v[mk] = 0
  10706. }
  10707. continue
  10708. }
  10709. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10710. if v != nil {
  10711. v[mk] = mv
  10712. }
  10713. }
  10714. d.d.ReadMapEnd()
  10715. d.depthDecr()
  10716. return v, changed
  10717. }
  10718. func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  10719. if rv.Kind() == reflect.Ptr {
  10720. vp := rv2i(rv).(*map[int]int64)
  10721. v, changed := fastpathTV.DecMapIntInt64V(*vp, true, d)
  10722. if changed {
  10723. *vp = v
  10724. }
  10725. } else {
  10726. fastpathTV.DecMapIntInt64V(rv2i(rv).(map[int]int64), false, d)
  10727. }
  10728. }
  10729. func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) {
  10730. v, changed := f.DecMapIntInt64V(*vp, true, d)
  10731. if changed {
  10732. *vp = v
  10733. }
  10734. }
  10735. func (fastpathT) DecMapIntInt64V(v map[int]int64, canChange bool,
  10736. d *Decoder) (_ map[int]int64, changed bool) {
  10737. containerLen := d.d.ReadMapStart()
  10738. if canChange && v == nil {
  10739. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10740. v = make(map[int]int64, xlen)
  10741. changed = true
  10742. }
  10743. if containerLen == 0 {
  10744. d.d.ReadMapEnd()
  10745. return v, changed
  10746. }
  10747. d.depthIncr()
  10748. var mk int
  10749. var mv int64
  10750. hasLen := containerLen > 0
  10751. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10752. if d.esep {
  10753. d.d.ReadMapElemKey()
  10754. }
  10755. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10756. if d.esep {
  10757. d.d.ReadMapElemValue()
  10758. }
  10759. if d.d.TryDecodeAsNil() {
  10760. if v == nil {
  10761. } else if d.h.DeleteOnNilMapValue {
  10762. delete(v, mk)
  10763. } else {
  10764. v[mk] = 0
  10765. }
  10766. continue
  10767. }
  10768. mv = d.d.DecodeInt64()
  10769. if v != nil {
  10770. v[mk] = mv
  10771. }
  10772. }
  10773. d.d.ReadMapEnd()
  10774. d.depthDecr()
  10775. return v, changed
  10776. }
  10777. func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  10778. if rv.Kind() == reflect.Ptr {
  10779. vp := rv2i(rv).(*map[int]float32)
  10780. v, changed := fastpathTV.DecMapIntFloat32V(*vp, true, d)
  10781. if changed {
  10782. *vp = v
  10783. }
  10784. } else {
  10785. fastpathTV.DecMapIntFloat32V(rv2i(rv).(map[int]float32), false, d)
  10786. }
  10787. }
  10788. func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) {
  10789. v, changed := f.DecMapIntFloat32V(*vp, true, d)
  10790. if changed {
  10791. *vp = v
  10792. }
  10793. }
  10794. func (fastpathT) DecMapIntFloat32V(v map[int]float32, canChange bool,
  10795. d *Decoder) (_ map[int]float32, changed bool) {
  10796. containerLen := d.d.ReadMapStart()
  10797. if canChange && v == nil {
  10798. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  10799. v = make(map[int]float32, xlen)
  10800. changed = true
  10801. }
  10802. if containerLen == 0 {
  10803. d.d.ReadMapEnd()
  10804. return v, changed
  10805. }
  10806. d.depthIncr()
  10807. var mk int
  10808. var mv float32
  10809. hasLen := containerLen > 0
  10810. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10811. if d.esep {
  10812. d.d.ReadMapElemKey()
  10813. }
  10814. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10815. if d.esep {
  10816. d.d.ReadMapElemValue()
  10817. }
  10818. if d.d.TryDecodeAsNil() {
  10819. if v == nil {
  10820. } else if d.h.DeleteOnNilMapValue {
  10821. delete(v, mk)
  10822. } else {
  10823. v[mk] = 0
  10824. }
  10825. continue
  10826. }
  10827. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  10828. if v != nil {
  10829. v[mk] = mv
  10830. }
  10831. }
  10832. d.d.ReadMapEnd()
  10833. d.depthDecr()
  10834. return v, changed
  10835. }
  10836. func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  10837. if rv.Kind() == reflect.Ptr {
  10838. vp := rv2i(rv).(*map[int]float64)
  10839. v, changed := fastpathTV.DecMapIntFloat64V(*vp, true, d)
  10840. if changed {
  10841. *vp = v
  10842. }
  10843. } else {
  10844. fastpathTV.DecMapIntFloat64V(rv2i(rv).(map[int]float64), false, d)
  10845. }
  10846. }
  10847. func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
  10848. v, changed := f.DecMapIntFloat64V(*vp, true, d)
  10849. if changed {
  10850. *vp = v
  10851. }
  10852. }
  10853. func (fastpathT) DecMapIntFloat64V(v map[int]float64, canChange bool,
  10854. d *Decoder) (_ map[int]float64, changed bool) {
  10855. containerLen := d.d.ReadMapStart()
  10856. if canChange && v == nil {
  10857. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10858. v = make(map[int]float64, xlen)
  10859. changed = true
  10860. }
  10861. if containerLen == 0 {
  10862. d.d.ReadMapEnd()
  10863. return v, changed
  10864. }
  10865. d.depthIncr()
  10866. var mk int
  10867. var mv float64
  10868. hasLen := containerLen > 0
  10869. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10870. if d.esep {
  10871. d.d.ReadMapElemKey()
  10872. }
  10873. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10874. if d.esep {
  10875. d.d.ReadMapElemValue()
  10876. }
  10877. if d.d.TryDecodeAsNil() {
  10878. if v == nil {
  10879. } else if d.h.DeleteOnNilMapValue {
  10880. delete(v, mk)
  10881. } else {
  10882. v[mk] = 0
  10883. }
  10884. continue
  10885. }
  10886. mv = d.d.DecodeFloat64()
  10887. if v != nil {
  10888. v[mk] = mv
  10889. }
  10890. }
  10891. d.d.ReadMapEnd()
  10892. d.depthDecr()
  10893. return v, changed
  10894. }
  10895. func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  10896. if rv.Kind() == reflect.Ptr {
  10897. vp := rv2i(rv).(*map[int]bool)
  10898. v, changed := fastpathTV.DecMapIntBoolV(*vp, true, d)
  10899. if changed {
  10900. *vp = v
  10901. }
  10902. } else {
  10903. fastpathTV.DecMapIntBoolV(rv2i(rv).(map[int]bool), false, d)
  10904. }
  10905. }
  10906. func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
  10907. v, changed := f.DecMapIntBoolV(*vp, true, d)
  10908. if changed {
  10909. *vp = v
  10910. }
  10911. }
  10912. func (fastpathT) DecMapIntBoolV(v map[int]bool, canChange bool,
  10913. d *Decoder) (_ map[int]bool, changed bool) {
  10914. containerLen := d.d.ReadMapStart()
  10915. if canChange && v == nil {
  10916. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10917. v = make(map[int]bool, xlen)
  10918. changed = true
  10919. }
  10920. if containerLen == 0 {
  10921. d.d.ReadMapEnd()
  10922. return v, changed
  10923. }
  10924. d.depthIncr()
  10925. var mk int
  10926. var mv bool
  10927. hasLen := containerLen > 0
  10928. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10929. if d.esep {
  10930. d.d.ReadMapElemKey()
  10931. }
  10932. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  10933. if d.esep {
  10934. d.d.ReadMapElemValue()
  10935. }
  10936. if d.d.TryDecodeAsNil() {
  10937. if v == nil {
  10938. } else if d.h.DeleteOnNilMapValue {
  10939. delete(v, mk)
  10940. } else {
  10941. v[mk] = false
  10942. }
  10943. continue
  10944. }
  10945. mv = d.d.DecodeBool()
  10946. if v != nil {
  10947. v[mk] = mv
  10948. }
  10949. }
  10950. d.d.ReadMapEnd()
  10951. d.depthDecr()
  10952. return v, changed
  10953. }
  10954. func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  10955. if rv.Kind() == reflect.Ptr {
  10956. vp := rv2i(rv).(*map[int64]interface{})
  10957. v, changed := fastpathTV.DecMapInt64IntfV(*vp, true, d)
  10958. if changed {
  10959. *vp = v
  10960. }
  10961. } else {
  10962. fastpathTV.DecMapInt64IntfV(rv2i(rv).(map[int64]interface{}), false, d)
  10963. }
  10964. }
  10965. func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) {
  10966. v, changed := f.DecMapInt64IntfV(*vp, true, d)
  10967. if changed {
  10968. *vp = v
  10969. }
  10970. }
  10971. func (fastpathT) DecMapInt64IntfV(v map[int64]interface{}, canChange bool,
  10972. d *Decoder) (_ map[int64]interface{}, changed bool) {
  10973. containerLen := d.d.ReadMapStart()
  10974. if canChange && v == nil {
  10975. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  10976. v = make(map[int64]interface{}, xlen)
  10977. changed = true
  10978. }
  10979. if containerLen == 0 {
  10980. d.d.ReadMapEnd()
  10981. return v, changed
  10982. }
  10983. d.depthIncr()
  10984. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  10985. var mk int64
  10986. var mv interface{}
  10987. hasLen := containerLen > 0
  10988. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  10989. if d.esep {
  10990. d.d.ReadMapElemKey()
  10991. }
  10992. mk = d.d.DecodeInt64()
  10993. if d.esep {
  10994. d.d.ReadMapElemValue()
  10995. }
  10996. if d.d.TryDecodeAsNil() {
  10997. if v == nil {
  10998. } else if d.h.DeleteOnNilMapValue {
  10999. delete(v, mk)
  11000. } else {
  11001. v[mk] = nil
  11002. }
  11003. continue
  11004. }
  11005. if mapGet {
  11006. mv = v[mk]
  11007. } else {
  11008. mv = nil
  11009. }
  11010. d.decode(&mv)
  11011. if v != nil {
  11012. v[mk] = mv
  11013. }
  11014. }
  11015. d.d.ReadMapEnd()
  11016. d.depthDecr()
  11017. return v, changed
  11018. }
  11019. func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  11020. if rv.Kind() == reflect.Ptr {
  11021. vp := rv2i(rv).(*map[int64]string)
  11022. v, changed := fastpathTV.DecMapInt64StringV(*vp, true, d)
  11023. if changed {
  11024. *vp = v
  11025. }
  11026. } else {
  11027. fastpathTV.DecMapInt64StringV(rv2i(rv).(map[int64]string), false, d)
  11028. }
  11029. }
  11030. func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) {
  11031. v, changed := f.DecMapInt64StringV(*vp, true, d)
  11032. if changed {
  11033. *vp = v
  11034. }
  11035. }
  11036. func (fastpathT) DecMapInt64StringV(v map[int64]string, canChange bool,
  11037. d *Decoder) (_ map[int64]string, changed bool) {
  11038. containerLen := d.d.ReadMapStart()
  11039. if canChange && v == nil {
  11040. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  11041. v = make(map[int64]string, xlen)
  11042. changed = true
  11043. }
  11044. if containerLen == 0 {
  11045. d.d.ReadMapEnd()
  11046. return v, changed
  11047. }
  11048. d.depthIncr()
  11049. var mk int64
  11050. var mv string
  11051. hasLen := containerLen > 0
  11052. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11053. if d.esep {
  11054. d.d.ReadMapElemKey()
  11055. }
  11056. mk = d.d.DecodeInt64()
  11057. if d.esep {
  11058. d.d.ReadMapElemValue()
  11059. }
  11060. if d.d.TryDecodeAsNil() {
  11061. if v == nil {
  11062. } else if d.h.DeleteOnNilMapValue {
  11063. delete(v, mk)
  11064. } else {
  11065. v[mk] = ""
  11066. }
  11067. continue
  11068. }
  11069. mv = d.d.DecodeString()
  11070. if v != nil {
  11071. v[mk] = mv
  11072. }
  11073. }
  11074. d.d.ReadMapEnd()
  11075. d.depthDecr()
  11076. return v, changed
  11077. }
  11078. func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  11079. if rv.Kind() == reflect.Ptr {
  11080. vp := rv2i(rv).(*map[int64]uint)
  11081. v, changed := fastpathTV.DecMapInt64UintV(*vp, true, d)
  11082. if changed {
  11083. *vp = v
  11084. }
  11085. } else {
  11086. fastpathTV.DecMapInt64UintV(rv2i(rv).(map[int64]uint), false, d)
  11087. }
  11088. }
  11089. func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) {
  11090. v, changed := f.DecMapInt64UintV(*vp, true, d)
  11091. if changed {
  11092. *vp = v
  11093. }
  11094. }
  11095. func (fastpathT) DecMapInt64UintV(v map[int64]uint, canChange bool,
  11096. d *Decoder) (_ map[int64]uint, changed bool) {
  11097. containerLen := d.d.ReadMapStart()
  11098. if canChange && v == nil {
  11099. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11100. v = make(map[int64]uint, xlen)
  11101. changed = true
  11102. }
  11103. if containerLen == 0 {
  11104. d.d.ReadMapEnd()
  11105. return v, changed
  11106. }
  11107. d.depthIncr()
  11108. var mk int64
  11109. var mv uint
  11110. hasLen := containerLen > 0
  11111. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11112. if d.esep {
  11113. d.d.ReadMapElemKey()
  11114. }
  11115. mk = d.d.DecodeInt64()
  11116. if d.esep {
  11117. d.d.ReadMapElemValue()
  11118. }
  11119. if d.d.TryDecodeAsNil() {
  11120. if v == nil {
  11121. } else if d.h.DeleteOnNilMapValue {
  11122. delete(v, mk)
  11123. } else {
  11124. v[mk] = 0
  11125. }
  11126. continue
  11127. }
  11128. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  11129. if v != nil {
  11130. v[mk] = mv
  11131. }
  11132. }
  11133. d.d.ReadMapEnd()
  11134. d.depthDecr()
  11135. return v, changed
  11136. }
  11137. func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  11138. if rv.Kind() == reflect.Ptr {
  11139. vp := rv2i(rv).(*map[int64]uint8)
  11140. v, changed := fastpathTV.DecMapInt64Uint8V(*vp, true, d)
  11141. if changed {
  11142. *vp = v
  11143. }
  11144. } else {
  11145. fastpathTV.DecMapInt64Uint8V(rv2i(rv).(map[int64]uint8), false, d)
  11146. }
  11147. }
  11148. func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) {
  11149. v, changed := f.DecMapInt64Uint8V(*vp, true, d)
  11150. if changed {
  11151. *vp = v
  11152. }
  11153. }
  11154. func (fastpathT) DecMapInt64Uint8V(v map[int64]uint8, canChange bool,
  11155. d *Decoder) (_ map[int64]uint8, changed bool) {
  11156. containerLen := d.d.ReadMapStart()
  11157. if canChange && v == nil {
  11158. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  11159. v = make(map[int64]uint8, xlen)
  11160. changed = true
  11161. }
  11162. if containerLen == 0 {
  11163. d.d.ReadMapEnd()
  11164. return v, changed
  11165. }
  11166. d.depthIncr()
  11167. var mk int64
  11168. var mv uint8
  11169. hasLen := containerLen > 0
  11170. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11171. if d.esep {
  11172. d.d.ReadMapElemKey()
  11173. }
  11174. mk = d.d.DecodeInt64()
  11175. if d.esep {
  11176. d.d.ReadMapElemValue()
  11177. }
  11178. if d.d.TryDecodeAsNil() {
  11179. if v == nil {
  11180. } else if d.h.DeleteOnNilMapValue {
  11181. delete(v, mk)
  11182. } else {
  11183. v[mk] = 0
  11184. }
  11185. continue
  11186. }
  11187. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  11188. if v != nil {
  11189. v[mk] = mv
  11190. }
  11191. }
  11192. d.d.ReadMapEnd()
  11193. d.depthDecr()
  11194. return v, changed
  11195. }
  11196. func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  11197. if rv.Kind() == reflect.Ptr {
  11198. vp := rv2i(rv).(*map[int64]uint64)
  11199. v, changed := fastpathTV.DecMapInt64Uint64V(*vp, true, d)
  11200. if changed {
  11201. *vp = v
  11202. }
  11203. } else {
  11204. fastpathTV.DecMapInt64Uint64V(rv2i(rv).(map[int64]uint64), false, d)
  11205. }
  11206. }
  11207. func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) {
  11208. v, changed := f.DecMapInt64Uint64V(*vp, true, d)
  11209. if changed {
  11210. *vp = v
  11211. }
  11212. }
  11213. func (fastpathT) DecMapInt64Uint64V(v map[int64]uint64, canChange bool,
  11214. d *Decoder) (_ map[int64]uint64, changed bool) {
  11215. containerLen := d.d.ReadMapStart()
  11216. if canChange && v == nil {
  11217. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11218. v = make(map[int64]uint64, xlen)
  11219. changed = true
  11220. }
  11221. if containerLen == 0 {
  11222. d.d.ReadMapEnd()
  11223. return v, changed
  11224. }
  11225. d.depthIncr()
  11226. var mk int64
  11227. var mv uint64
  11228. hasLen := containerLen > 0
  11229. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11230. if d.esep {
  11231. d.d.ReadMapElemKey()
  11232. }
  11233. mk = d.d.DecodeInt64()
  11234. if d.esep {
  11235. d.d.ReadMapElemValue()
  11236. }
  11237. if d.d.TryDecodeAsNil() {
  11238. if v == nil {
  11239. } else if d.h.DeleteOnNilMapValue {
  11240. delete(v, mk)
  11241. } else {
  11242. v[mk] = 0
  11243. }
  11244. continue
  11245. }
  11246. mv = d.d.DecodeUint64()
  11247. if v != nil {
  11248. v[mk] = mv
  11249. }
  11250. }
  11251. d.d.ReadMapEnd()
  11252. d.depthDecr()
  11253. return v, changed
  11254. }
  11255. func (d *Decoder) fastpathDecMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) {
  11256. if rv.Kind() == reflect.Ptr {
  11257. vp := rv2i(rv).(*map[int64]uintptr)
  11258. v, changed := fastpathTV.DecMapInt64UintptrV(*vp, true, d)
  11259. if changed {
  11260. *vp = v
  11261. }
  11262. } else {
  11263. fastpathTV.DecMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), false, d)
  11264. }
  11265. }
  11266. func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, d *Decoder) {
  11267. v, changed := f.DecMapInt64UintptrV(*vp, true, d)
  11268. if changed {
  11269. *vp = v
  11270. }
  11271. }
  11272. func (fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, canChange bool,
  11273. d *Decoder) (_ map[int64]uintptr, changed bool) {
  11274. containerLen := d.d.ReadMapStart()
  11275. if canChange && v == nil {
  11276. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11277. v = make(map[int64]uintptr, xlen)
  11278. changed = true
  11279. }
  11280. if containerLen == 0 {
  11281. d.d.ReadMapEnd()
  11282. return v, changed
  11283. }
  11284. d.depthIncr()
  11285. var mk int64
  11286. var mv uintptr
  11287. hasLen := containerLen > 0
  11288. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11289. if d.esep {
  11290. d.d.ReadMapElemKey()
  11291. }
  11292. mk = d.d.DecodeInt64()
  11293. if d.esep {
  11294. d.d.ReadMapElemValue()
  11295. }
  11296. if d.d.TryDecodeAsNil() {
  11297. if v == nil {
  11298. } else if d.h.DeleteOnNilMapValue {
  11299. delete(v, mk)
  11300. } else {
  11301. v[mk] = 0
  11302. }
  11303. continue
  11304. }
  11305. mv = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  11306. if v != nil {
  11307. v[mk] = mv
  11308. }
  11309. }
  11310. d.d.ReadMapEnd()
  11311. d.depthDecr()
  11312. return v, changed
  11313. }
  11314. func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  11315. if rv.Kind() == reflect.Ptr {
  11316. vp := rv2i(rv).(*map[int64]int)
  11317. v, changed := fastpathTV.DecMapInt64IntV(*vp, true, d)
  11318. if changed {
  11319. *vp = v
  11320. }
  11321. } else {
  11322. fastpathTV.DecMapInt64IntV(rv2i(rv).(map[int64]int), false, d)
  11323. }
  11324. }
  11325. func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) {
  11326. v, changed := f.DecMapInt64IntV(*vp, true, d)
  11327. if changed {
  11328. *vp = v
  11329. }
  11330. }
  11331. func (fastpathT) DecMapInt64IntV(v map[int64]int, canChange bool,
  11332. d *Decoder) (_ map[int64]int, changed bool) {
  11333. containerLen := d.d.ReadMapStart()
  11334. if canChange && v == nil {
  11335. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11336. v = make(map[int64]int, xlen)
  11337. changed = true
  11338. }
  11339. if containerLen == 0 {
  11340. d.d.ReadMapEnd()
  11341. return v, changed
  11342. }
  11343. d.depthIncr()
  11344. var mk int64
  11345. var mv int
  11346. hasLen := containerLen > 0
  11347. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11348. if d.esep {
  11349. d.d.ReadMapElemKey()
  11350. }
  11351. mk = d.d.DecodeInt64()
  11352. if d.esep {
  11353. d.d.ReadMapElemValue()
  11354. }
  11355. if d.d.TryDecodeAsNil() {
  11356. if v == nil {
  11357. } else if d.h.DeleteOnNilMapValue {
  11358. delete(v, mk)
  11359. } else {
  11360. v[mk] = 0
  11361. }
  11362. continue
  11363. }
  11364. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  11365. if v != nil {
  11366. v[mk] = mv
  11367. }
  11368. }
  11369. d.d.ReadMapEnd()
  11370. d.depthDecr()
  11371. return v, changed
  11372. }
  11373. func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  11374. if rv.Kind() == reflect.Ptr {
  11375. vp := rv2i(rv).(*map[int64]int64)
  11376. v, changed := fastpathTV.DecMapInt64Int64V(*vp, true, d)
  11377. if changed {
  11378. *vp = v
  11379. }
  11380. } else {
  11381. fastpathTV.DecMapInt64Int64V(rv2i(rv).(map[int64]int64), false, d)
  11382. }
  11383. }
  11384. func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) {
  11385. v, changed := f.DecMapInt64Int64V(*vp, true, d)
  11386. if changed {
  11387. *vp = v
  11388. }
  11389. }
  11390. func (fastpathT) DecMapInt64Int64V(v map[int64]int64, canChange bool,
  11391. d *Decoder) (_ map[int64]int64, changed bool) {
  11392. containerLen := d.d.ReadMapStart()
  11393. if canChange && v == nil {
  11394. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11395. v = make(map[int64]int64, xlen)
  11396. changed = true
  11397. }
  11398. if containerLen == 0 {
  11399. d.d.ReadMapEnd()
  11400. return v, changed
  11401. }
  11402. d.depthIncr()
  11403. var mk int64
  11404. var mv int64
  11405. hasLen := containerLen > 0
  11406. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11407. if d.esep {
  11408. d.d.ReadMapElemKey()
  11409. }
  11410. mk = d.d.DecodeInt64()
  11411. if d.esep {
  11412. d.d.ReadMapElemValue()
  11413. }
  11414. if d.d.TryDecodeAsNil() {
  11415. if v == nil {
  11416. } else if d.h.DeleteOnNilMapValue {
  11417. delete(v, mk)
  11418. } else {
  11419. v[mk] = 0
  11420. }
  11421. continue
  11422. }
  11423. mv = d.d.DecodeInt64()
  11424. if v != nil {
  11425. v[mk] = mv
  11426. }
  11427. }
  11428. d.d.ReadMapEnd()
  11429. d.depthDecr()
  11430. return v, changed
  11431. }
  11432. func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  11433. if rv.Kind() == reflect.Ptr {
  11434. vp := rv2i(rv).(*map[int64]float32)
  11435. v, changed := fastpathTV.DecMapInt64Float32V(*vp, true, d)
  11436. if changed {
  11437. *vp = v
  11438. }
  11439. } else {
  11440. fastpathTV.DecMapInt64Float32V(rv2i(rv).(map[int64]float32), false, d)
  11441. }
  11442. }
  11443. func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) {
  11444. v, changed := f.DecMapInt64Float32V(*vp, true, d)
  11445. if changed {
  11446. *vp = v
  11447. }
  11448. }
  11449. func (fastpathT) DecMapInt64Float32V(v map[int64]float32, canChange bool,
  11450. d *Decoder) (_ map[int64]float32, changed bool) {
  11451. containerLen := d.d.ReadMapStart()
  11452. if canChange && v == nil {
  11453. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  11454. v = make(map[int64]float32, xlen)
  11455. changed = true
  11456. }
  11457. if containerLen == 0 {
  11458. d.d.ReadMapEnd()
  11459. return v, changed
  11460. }
  11461. d.depthIncr()
  11462. var mk int64
  11463. var mv float32
  11464. hasLen := containerLen > 0
  11465. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11466. if d.esep {
  11467. d.d.ReadMapElemKey()
  11468. }
  11469. mk = d.d.DecodeInt64()
  11470. if d.esep {
  11471. d.d.ReadMapElemValue()
  11472. }
  11473. if d.d.TryDecodeAsNil() {
  11474. if v == nil {
  11475. } else if d.h.DeleteOnNilMapValue {
  11476. delete(v, mk)
  11477. } else {
  11478. v[mk] = 0
  11479. }
  11480. continue
  11481. }
  11482. mv = float32(chkOvf.Float32V(d.d.DecodeFloat64()))
  11483. if v != nil {
  11484. v[mk] = mv
  11485. }
  11486. }
  11487. d.d.ReadMapEnd()
  11488. d.depthDecr()
  11489. return v, changed
  11490. }
  11491. func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  11492. if rv.Kind() == reflect.Ptr {
  11493. vp := rv2i(rv).(*map[int64]float64)
  11494. v, changed := fastpathTV.DecMapInt64Float64V(*vp, true, d)
  11495. if changed {
  11496. *vp = v
  11497. }
  11498. } else {
  11499. fastpathTV.DecMapInt64Float64V(rv2i(rv).(map[int64]float64), false, d)
  11500. }
  11501. }
  11502. func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) {
  11503. v, changed := f.DecMapInt64Float64V(*vp, true, d)
  11504. if changed {
  11505. *vp = v
  11506. }
  11507. }
  11508. func (fastpathT) DecMapInt64Float64V(v map[int64]float64, canChange bool,
  11509. d *Decoder) (_ map[int64]float64, changed bool) {
  11510. containerLen := d.d.ReadMapStart()
  11511. if canChange && v == nil {
  11512. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11513. v = make(map[int64]float64, xlen)
  11514. changed = true
  11515. }
  11516. if containerLen == 0 {
  11517. d.d.ReadMapEnd()
  11518. return v, changed
  11519. }
  11520. d.depthIncr()
  11521. var mk int64
  11522. var mv float64
  11523. hasLen := containerLen > 0
  11524. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11525. if d.esep {
  11526. d.d.ReadMapElemKey()
  11527. }
  11528. mk = d.d.DecodeInt64()
  11529. if d.esep {
  11530. d.d.ReadMapElemValue()
  11531. }
  11532. if d.d.TryDecodeAsNil() {
  11533. if v == nil {
  11534. } else if d.h.DeleteOnNilMapValue {
  11535. delete(v, mk)
  11536. } else {
  11537. v[mk] = 0
  11538. }
  11539. continue
  11540. }
  11541. mv = d.d.DecodeFloat64()
  11542. if v != nil {
  11543. v[mk] = mv
  11544. }
  11545. }
  11546. d.d.ReadMapEnd()
  11547. d.depthDecr()
  11548. return v, changed
  11549. }
  11550. func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  11551. if rv.Kind() == reflect.Ptr {
  11552. vp := rv2i(rv).(*map[int64]bool)
  11553. v, changed := fastpathTV.DecMapInt64BoolV(*vp, true, d)
  11554. if changed {
  11555. *vp = v
  11556. }
  11557. } else {
  11558. fastpathTV.DecMapInt64BoolV(rv2i(rv).(map[int64]bool), false, d)
  11559. }
  11560. }
  11561. func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) {
  11562. v, changed := f.DecMapInt64BoolV(*vp, true, d)
  11563. if changed {
  11564. *vp = v
  11565. }
  11566. }
  11567. func (fastpathT) DecMapInt64BoolV(v map[int64]bool, canChange bool,
  11568. d *Decoder) (_ map[int64]bool, changed bool) {
  11569. containerLen := d.d.ReadMapStart()
  11570. if canChange && v == nil {
  11571. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  11572. v = make(map[int64]bool, xlen)
  11573. changed = true
  11574. }
  11575. if containerLen == 0 {
  11576. d.d.ReadMapEnd()
  11577. return v, changed
  11578. }
  11579. d.depthIncr()
  11580. var mk int64
  11581. var mv bool
  11582. hasLen := containerLen > 0
  11583. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  11584. if d.esep {
  11585. d.d.ReadMapElemKey()
  11586. }
  11587. mk = d.d.DecodeInt64()
  11588. if d.esep {
  11589. d.d.ReadMapElemValue()
  11590. }
  11591. if d.d.TryDecodeAsNil() {
  11592. if v == nil {
  11593. } else if d.h.DeleteOnNilMapValue {
  11594. delete(v, mk)
  11595. } else {
  11596. v[mk] = false
  11597. }
  11598. continue
  11599. }
  11600. mv = d.d.DecodeBool()
  11601. if v != nil {
  11602. v[mk] = mv
  11603. }
  11604. }
  11605. d.d.ReadMapEnd()
  11606. d.depthDecr()
  11607. return v, changed
  11608. }