fast-path.generated.go 220 KB

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