fast-path.generated.go 272 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029
  1. // +build !notfastpath
  2. // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
  3. // Use of this source code is governed by a MIT license found in the LICENSE file.
  4. // Code generated from fast-path.go.tmpl - DO NOT EDIT.
  5. package codec
  6. // Fast path functions try to create a fast path encode or decode implementation
  7. // for common maps and slices.
  8. //
  9. // We define the functions and register then in this single file
  10. // so as not to pollute the encode.go and decode.go, and create a dependency in there.
  11. // This file can be omitted without causing a build failure.
  12. //
  13. // The advantage of fast paths is:
  14. // - Many calls bypass reflection altogether
  15. //
  16. // Currently support
  17. // - slice of all builtin types,
  18. // - map of all builtin types to string or interface value
  19. // - symmetrical maps of all builtin types (e.g. str-str, uint8-uint8)
  20. // This should provide adequate "typical" implementations.
  21. //
  22. // Note that fast track decode functions must handle values for which an address cannot be obtained.
  23. // For example:
  24. // m2 := map[string]int{}
  25. // p2 := []interface{}{m2}
  26. // // decoding into p2 will bomb if fast track functions do not treat like unaddressable.
  27. //
  28. import (
  29. "reflect"
  30. "sort"
  31. )
  32. const fastpathEnabled = true
  33. const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v"
  34. type fastpathT struct{}
  35. var fastpathTV fastpathT
  36. type fastpathE struct {
  37. rtid uintptr
  38. rt reflect.Type
  39. encfn func(*Encoder, *codecFnInfo, reflect.Value)
  40. decfn func(*Decoder, *codecFnInfo, reflect.Value)
  41. }
  42. type fastpathA [92]fastpathE
  43. func (x *fastpathA) index(rtid uintptr) int {
  44. // use binary search to grab the index (adapted from sort/search.go)
  45. // Note: we use goto (instead of for loop) so this can be inlined.
  46. // h, i, j := 0, 0, len(x)
  47. var h, i uint
  48. var j = uint(len(x))
  49. LOOP:
  50. if i < j {
  51. h = i + (j-i)/2
  52. if x[h].rtid < rtid {
  53. i = h + 1
  54. } else {
  55. j = h
  56. }
  57. goto LOOP
  58. }
  59. if i < uint(len(x)) && x[i].rtid == rtid {
  60. return int(i)
  61. }
  62. return -1
  63. }
  64. type fastpathAslice []fastpathE
  65. func (x fastpathAslice) Len() int { return len(x) }
  66. func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid }
  67. func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] }
  68. var fastpathAV fastpathA
  69. // due to possible initialization loop error, make fastpath in an init()
  70. func init() {
  71. var i uint = 0
  72. fn := func(v interface{},
  73. fe func(*Encoder, *codecFnInfo, reflect.Value),
  74. fd func(*Decoder, *codecFnInfo, reflect.Value)) {
  75. xrt := reflect.TypeOf(v)
  76. xptr := rt2id(xrt)
  77. fastpathAV[i] = fastpathE{xptr, xrt, fe, fd}
  78. i++
  79. }
  80. fn([]interface{}(nil), (*Encoder).fastpathEncSliceIntfR, (*Decoder).fastpathDecSliceIntfR)
  81. fn([]string(nil), (*Encoder).fastpathEncSliceStringR, (*Decoder).fastpathDecSliceStringR)
  82. fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R)
  83. fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R)
  84. fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR)
  85. fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R)
  86. fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R)
  87. fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R)
  88. fn([]uintptr(nil), (*Encoder).fastpathEncSliceUintptrR, (*Decoder).fastpathDecSliceUintptrR)
  89. fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR)
  90. fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R)
  91. fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R)
  92. fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R)
  93. fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R)
  94. fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR)
  95. fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR)
  96. fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR)
  97. fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR)
  98. fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R)
  99. fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R)
  100. fn(map[string]uintptr(nil), (*Encoder).fastpathEncMapStringUintptrR, (*Decoder).fastpathDecMapStringUintptrR)
  101. fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR)
  102. fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R)
  103. fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R)
  104. fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R)
  105. fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR)
  106. fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR)
  107. fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR)
  108. fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR)
  109. fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R)
  110. fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R)
  111. fn(map[uint]uintptr(nil), (*Encoder).fastpathEncMapUintUintptrR, (*Decoder).fastpathDecMapUintUintptrR)
  112. fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR)
  113. fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R)
  114. fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R)
  115. fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R)
  116. fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR)
  117. fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR)
  118. fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR)
  119. fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR)
  120. fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R)
  121. fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R)
  122. fn(map[uint8]uintptr(nil), (*Encoder).fastpathEncMapUint8UintptrR, (*Decoder).fastpathDecMapUint8UintptrR)
  123. fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR)
  124. fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R)
  125. fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R)
  126. fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R)
  127. fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR)
  128. fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR)
  129. fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR)
  130. fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR)
  131. fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R)
  132. fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R)
  133. fn(map[uint64]uintptr(nil), (*Encoder).fastpathEncMapUint64UintptrR, (*Decoder).fastpathDecMapUint64UintptrR)
  134. fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR)
  135. fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R)
  136. fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R)
  137. fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R)
  138. fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR)
  139. fn(map[uintptr]interface{}(nil), (*Encoder).fastpathEncMapUintptrIntfR, (*Decoder).fastpathDecMapUintptrIntfR)
  140. fn(map[uintptr]string(nil), (*Encoder).fastpathEncMapUintptrStringR, (*Decoder).fastpathDecMapUintptrStringR)
  141. fn(map[uintptr]uint(nil), (*Encoder).fastpathEncMapUintptrUintR, (*Decoder).fastpathDecMapUintptrUintR)
  142. fn(map[uintptr]uint8(nil), (*Encoder).fastpathEncMapUintptrUint8R, (*Decoder).fastpathDecMapUintptrUint8R)
  143. fn(map[uintptr]uint64(nil), (*Encoder).fastpathEncMapUintptrUint64R, (*Decoder).fastpathDecMapUintptrUint64R)
  144. fn(map[uintptr]uintptr(nil), (*Encoder).fastpathEncMapUintptrUintptrR, (*Decoder).fastpathDecMapUintptrUintptrR)
  145. fn(map[uintptr]int(nil), (*Encoder).fastpathEncMapUintptrIntR, (*Decoder).fastpathDecMapUintptrIntR)
  146. fn(map[uintptr]int64(nil), (*Encoder).fastpathEncMapUintptrInt64R, (*Decoder).fastpathDecMapUintptrInt64R)
  147. fn(map[uintptr]float32(nil), (*Encoder).fastpathEncMapUintptrFloat32R, (*Decoder).fastpathDecMapUintptrFloat32R)
  148. fn(map[uintptr]float64(nil), (*Encoder).fastpathEncMapUintptrFloat64R, (*Decoder).fastpathDecMapUintptrFloat64R)
  149. fn(map[uintptr]bool(nil), (*Encoder).fastpathEncMapUintptrBoolR, (*Decoder).fastpathDecMapUintptrBoolR)
  150. fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR)
  151. fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR)
  152. fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR)
  153. fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R)
  154. fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R)
  155. fn(map[int]uintptr(nil), (*Encoder).fastpathEncMapIntUintptrR, (*Decoder).fastpathDecMapIntUintptrR)
  156. fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR)
  157. fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R)
  158. fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R)
  159. fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R)
  160. fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR)
  161. fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR)
  162. fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR)
  163. fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR)
  164. fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R)
  165. fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R)
  166. fn(map[int64]uintptr(nil), (*Encoder).fastpathEncMapInt64UintptrR, (*Decoder).fastpathDecMapInt64UintptrR)
  167. fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR)
  168. fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R)
  169. fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R)
  170. fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R)
  171. fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR)
  172. sort.Sort(fastpathAslice(fastpathAV[:]))
  173. }
  174. // -- encode
  175. // -- -- fast path type switch
  176. func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
  177. switch v := iv.(type) {
  178. case []interface{}:
  179. fastpathTV.EncSliceIntfV(v, e)
  180. case *[]interface{}:
  181. fastpathTV.EncSliceIntfV(*v, e)
  182. case []string:
  183. fastpathTV.EncSliceStringV(v, e)
  184. case *[]string:
  185. fastpathTV.EncSliceStringV(*v, e)
  186. case []float32:
  187. fastpathTV.EncSliceFloat32V(v, e)
  188. case *[]float32:
  189. fastpathTV.EncSliceFloat32V(*v, e)
  190. case []float64:
  191. fastpathTV.EncSliceFloat64V(v, e)
  192. case *[]float64:
  193. fastpathTV.EncSliceFloat64V(*v, e)
  194. case []uint:
  195. fastpathTV.EncSliceUintV(v, e)
  196. case *[]uint:
  197. fastpathTV.EncSliceUintV(*v, e)
  198. case []uint16:
  199. fastpathTV.EncSliceUint16V(v, e)
  200. case *[]uint16:
  201. fastpathTV.EncSliceUint16V(*v, e)
  202. case []uint32:
  203. fastpathTV.EncSliceUint32V(v, e)
  204. case *[]uint32:
  205. fastpathTV.EncSliceUint32V(*v, e)
  206. case []uint64:
  207. fastpathTV.EncSliceUint64V(v, e)
  208. case *[]uint64:
  209. fastpathTV.EncSliceUint64V(*v, e)
  210. case []uintptr:
  211. fastpathTV.EncSliceUintptrV(v, e)
  212. case *[]uintptr:
  213. fastpathTV.EncSliceUintptrV(*v, e)
  214. case []int:
  215. fastpathTV.EncSliceIntV(v, e)
  216. case *[]int:
  217. fastpathTV.EncSliceIntV(*v, e)
  218. case []int8:
  219. fastpathTV.EncSliceInt8V(v, e)
  220. case *[]int8:
  221. fastpathTV.EncSliceInt8V(*v, e)
  222. case []int16:
  223. fastpathTV.EncSliceInt16V(v, e)
  224. case *[]int16:
  225. fastpathTV.EncSliceInt16V(*v, e)
  226. case []int32:
  227. fastpathTV.EncSliceInt32V(v, e)
  228. case *[]int32:
  229. fastpathTV.EncSliceInt32V(*v, e)
  230. case []int64:
  231. fastpathTV.EncSliceInt64V(v, e)
  232. case *[]int64:
  233. fastpathTV.EncSliceInt64V(*v, e)
  234. case []bool:
  235. fastpathTV.EncSliceBoolV(v, e)
  236. case *[]bool:
  237. fastpathTV.EncSliceBoolV(*v, e)
  238. case map[string]interface{}:
  239. fastpathTV.EncMapStringIntfV(v, e)
  240. case *map[string]interface{}:
  241. fastpathTV.EncMapStringIntfV(*v, e)
  242. case map[string]string:
  243. fastpathTV.EncMapStringStringV(v, e)
  244. case *map[string]string:
  245. fastpathTV.EncMapStringStringV(*v, e)
  246. case map[string]uint:
  247. fastpathTV.EncMapStringUintV(v, e)
  248. case *map[string]uint:
  249. fastpathTV.EncMapStringUintV(*v, e)
  250. case map[string]uint8:
  251. fastpathTV.EncMapStringUint8V(v, e)
  252. case *map[string]uint8:
  253. fastpathTV.EncMapStringUint8V(*v, e)
  254. case map[string]uint64:
  255. fastpathTV.EncMapStringUint64V(v, e)
  256. case *map[string]uint64:
  257. fastpathTV.EncMapStringUint64V(*v, e)
  258. case map[string]uintptr:
  259. fastpathTV.EncMapStringUintptrV(v, e)
  260. case *map[string]uintptr:
  261. fastpathTV.EncMapStringUintptrV(*v, e)
  262. case map[string]int:
  263. fastpathTV.EncMapStringIntV(v, e)
  264. case *map[string]int:
  265. fastpathTV.EncMapStringIntV(*v, e)
  266. case map[string]int64:
  267. fastpathTV.EncMapStringInt64V(v, e)
  268. case *map[string]int64:
  269. fastpathTV.EncMapStringInt64V(*v, e)
  270. case map[string]float32:
  271. fastpathTV.EncMapStringFloat32V(v, e)
  272. case *map[string]float32:
  273. fastpathTV.EncMapStringFloat32V(*v, e)
  274. case map[string]float64:
  275. fastpathTV.EncMapStringFloat64V(v, e)
  276. case *map[string]float64:
  277. fastpathTV.EncMapStringFloat64V(*v, e)
  278. case map[string]bool:
  279. fastpathTV.EncMapStringBoolV(v, e)
  280. case *map[string]bool:
  281. fastpathTV.EncMapStringBoolV(*v, e)
  282. case map[uint]interface{}:
  283. fastpathTV.EncMapUintIntfV(v, e)
  284. case *map[uint]interface{}:
  285. fastpathTV.EncMapUintIntfV(*v, e)
  286. case map[uint]string:
  287. fastpathTV.EncMapUintStringV(v, e)
  288. case *map[uint]string:
  289. fastpathTV.EncMapUintStringV(*v, e)
  290. case map[uint]uint:
  291. fastpathTV.EncMapUintUintV(v, e)
  292. case *map[uint]uint:
  293. fastpathTV.EncMapUintUintV(*v, e)
  294. case map[uint]uint8:
  295. fastpathTV.EncMapUintUint8V(v, e)
  296. case *map[uint]uint8:
  297. fastpathTV.EncMapUintUint8V(*v, e)
  298. case map[uint]uint64:
  299. fastpathTV.EncMapUintUint64V(v, e)
  300. case *map[uint]uint64:
  301. fastpathTV.EncMapUintUint64V(*v, e)
  302. case map[uint]uintptr:
  303. fastpathTV.EncMapUintUintptrV(v, e)
  304. case *map[uint]uintptr:
  305. fastpathTV.EncMapUintUintptrV(*v, e)
  306. case map[uint]int:
  307. fastpathTV.EncMapUintIntV(v, e)
  308. case *map[uint]int:
  309. fastpathTV.EncMapUintIntV(*v, e)
  310. case map[uint]int64:
  311. fastpathTV.EncMapUintInt64V(v, e)
  312. case *map[uint]int64:
  313. fastpathTV.EncMapUintInt64V(*v, e)
  314. case map[uint]float32:
  315. fastpathTV.EncMapUintFloat32V(v, e)
  316. case *map[uint]float32:
  317. fastpathTV.EncMapUintFloat32V(*v, e)
  318. case map[uint]float64:
  319. fastpathTV.EncMapUintFloat64V(v, e)
  320. case *map[uint]float64:
  321. fastpathTV.EncMapUintFloat64V(*v, e)
  322. case map[uint]bool:
  323. fastpathTV.EncMapUintBoolV(v, e)
  324. case *map[uint]bool:
  325. fastpathTV.EncMapUintBoolV(*v, e)
  326. case map[uint8]interface{}:
  327. fastpathTV.EncMapUint8IntfV(v, e)
  328. case *map[uint8]interface{}:
  329. fastpathTV.EncMapUint8IntfV(*v, e)
  330. case map[uint8]string:
  331. fastpathTV.EncMapUint8StringV(v, e)
  332. case *map[uint8]string:
  333. fastpathTV.EncMapUint8StringV(*v, e)
  334. case map[uint8]uint:
  335. fastpathTV.EncMapUint8UintV(v, e)
  336. case *map[uint8]uint:
  337. fastpathTV.EncMapUint8UintV(*v, e)
  338. case map[uint8]uint8:
  339. fastpathTV.EncMapUint8Uint8V(v, e)
  340. case *map[uint8]uint8:
  341. fastpathTV.EncMapUint8Uint8V(*v, e)
  342. case map[uint8]uint64:
  343. fastpathTV.EncMapUint8Uint64V(v, e)
  344. case *map[uint8]uint64:
  345. fastpathTV.EncMapUint8Uint64V(*v, e)
  346. case map[uint8]uintptr:
  347. fastpathTV.EncMapUint8UintptrV(v, e)
  348. case *map[uint8]uintptr:
  349. fastpathTV.EncMapUint8UintptrV(*v, e)
  350. case map[uint8]int:
  351. fastpathTV.EncMapUint8IntV(v, e)
  352. case *map[uint8]int:
  353. fastpathTV.EncMapUint8IntV(*v, e)
  354. case map[uint8]int64:
  355. fastpathTV.EncMapUint8Int64V(v, e)
  356. case *map[uint8]int64:
  357. fastpathTV.EncMapUint8Int64V(*v, e)
  358. case map[uint8]float32:
  359. fastpathTV.EncMapUint8Float32V(v, e)
  360. case *map[uint8]float32:
  361. fastpathTV.EncMapUint8Float32V(*v, e)
  362. case map[uint8]float64:
  363. fastpathTV.EncMapUint8Float64V(v, e)
  364. case *map[uint8]float64:
  365. fastpathTV.EncMapUint8Float64V(*v, e)
  366. case map[uint8]bool:
  367. fastpathTV.EncMapUint8BoolV(v, e)
  368. case *map[uint8]bool:
  369. fastpathTV.EncMapUint8BoolV(*v, e)
  370. case map[uint64]interface{}:
  371. fastpathTV.EncMapUint64IntfV(v, e)
  372. case *map[uint64]interface{}:
  373. fastpathTV.EncMapUint64IntfV(*v, e)
  374. case map[uint64]string:
  375. fastpathTV.EncMapUint64StringV(v, e)
  376. case *map[uint64]string:
  377. fastpathTV.EncMapUint64StringV(*v, e)
  378. case map[uint64]uint:
  379. fastpathTV.EncMapUint64UintV(v, e)
  380. case *map[uint64]uint:
  381. fastpathTV.EncMapUint64UintV(*v, e)
  382. case map[uint64]uint8:
  383. fastpathTV.EncMapUint64Uint8V(v, e)
  384. case *map[uint64]uint8:
  385. fastpathTV.EncMapUint64Uint8V(*v, e)
  386. case map[uint64]uint64:
  387. fastpathTV.EncMapUint64Uint64V(v, e)
  388. case *map[uint64]uint64:
  389. fastpathTV.EncMapUint64Uint64V(*v, e)
  390. case map[uint64]uintptr:
  391. fastpathTV.EncMapUint64UintptrV(v, e)
  392. case *map[uint64]uintptr:
  393. fastpathTV.EncMapUint64UintptrV(*v, e)
  394. case map[uint64]int:
  395. fastpathTV.EncMapUint64IntV(v, e)
  396. case *map[uint64]int:
  397. fastpathTV.EncMapUint64IntV(*v, e)
  398. case map[uint64]int64:
  399. fastpathTV.EncMapUint64Int64V(v, e)
  400. case *map[uint64]int64:
  401. fastpathTV.EncMapUint64Int64V(*v, e)
  402. case map[uint64]float32:
  403. fastpathTV.EncMapUint64Float32V(v, e)
  404. case *map[uint64]float32:
  405. fastpathTV.EncMapUint64Float32V(*v, e)
  406. case map[uint64]float64:
  407. fastpathTV.EncMapUint64Float64V(v, e)
  408. case *map[uint64]float64:
  409. fastpathTV.EncMapUint64Float64V(*v, e)
  410. case map[uint64]bool:
  411. fastpathTV.EncMapUint64BoolV(v, e)
  412. case *map[uint64]bool:
  413. fastpathTV.EncMapUint64BoolV(*v, e)
  414. case map[uintptr]interface{}:
  415. fastpathTV.EncMapUintptrIntfV(v, e)
  416. case *map[uintptr]interface{}:
  417. fastpathTV.EncMapUintptrIntfV(*v, e)
  418. case map[uintptr]string:
  419. fastpathTV.EncMapUintptrStringV(v, e)
  420. case *map[uintptr]string:
  421. fastpathTV.EncMapUintptrStringV(*v, e)
  422. case map[uintptr]uint:
  423. fastpathTV.EncMapUintptrUintV(v, e)
  424. case *map[uintptr]uint:
  425. fastpathTV.EncMapUintptrUintV(*v, e)
  426. case map[uintptr]uint8:
  427. fastpathTV.EncMapUintptrUint8V(v, e)
  428. case *map[uintptr]uint8:
  429. fastpathTV.EncMapUintptrUint8V(*v, e)
  430. case map[uintptr]uint64:
  431. fastpathTV.EncMapUintptrUint64V(v, e)
  432. case *map[uintptr]uint64:
  433. fastpathTV.EncMapUintptrUint64V(*v, e)
  434. case map[uintptr]uintptr:
  435. fastpathTV.EncMapUintptrUintptrV(v, e)
  436. case *map[uintptr]uintptr:
  437. fastpathTV.EncMapUintptrUintptrV(*v, e)
  438. case map[uintptr]int:
  439. fastpathTV.EncMapUintptrIntV(v, e)
  440. case *map[uintptr]int:
  441. fastpathTV.EncMapUintptrIntV(*v, e)
  442. case map[uintptr]int64:
  443. fastpathTV.EncMapUintptrInt64V(v, e)
  444. case *map[uintptr]int64:
  445. fastpathTV.EncMapUintptrInt64V(*v, e)
  446. case map[uintptr]float32:
  447. fastpathTV.EncMapUintptrFloat32V(v, e)
  448. case *map[uintptr]float32:
  449. fastpathTV.EncMapUintptrFloat32V(*v, e)
  450. case map[uintptr]float64:
  451. fastpathTV.EncMapUintptrFloat64V(v, e)
  452. case *map[uintptr]float64:
  453. fastpathTV.EncMapUintptrFloat64V(*v, e)
  454. case map[uintptr]bool:
  455. fastpathTV.EncMapUintptrBoolV(v, e)
  456. case *map[uintptr]bool:
  457. fastpathTV.EncMapUintptrBoolV(*v, e)
  458. case map[int]interface{}:
  459. fastpathTV.EncMapIntIntfV(v, e)
  460. case *map[int]interface{}:
  461. fastpathTV.EncMapIntIntfV(*v, e)
  462. case map[int]string:
  463. fastpathTV.EncMapIntStringV(v, e)
  464. case *map[int]string:
  465. fastpathTV.EncMapIntStringV(*v, e)
  466. case map[int]uint:
  467. fastpathTV.EncMapIntUintV(v, e)
  468. case *map[int]uint:
  469. fastpathTV.EncMapIntUintV(*v, e)
  470. case map[int]uint8:
  471. fastpathTV.EncMapIntUint8V(v, e)
  472. case *map[int]uint8:
  473. fastpathTV.EncMapIntUint8V(*v, e)
  474. case map[int]uint64:
  475. fastpathTV.EncMapIntUint64V(v, e)
  476. case *map[int]uint64:
  477. fastpathTV.EncMapIntUint64V(*v, e)
  478. case map[int]uintptr:
  479. fastpathTV.EncMapIntUintptrV(v, e)
  480. case *map[int]uintptr:
  481. fastpathTV.EncMapIntUintptrV(*v, e)
  482. case map[int]int:
  483. fastpathTV.EncMapIntIntV(v, e)
  484. case *map[int]int:
  485. fastpathTV.EncMapIntIntV(*v, e)
  486. case map[int]int64:
  487. fastpathTV.EncMapIntInt64V(v, e)
  488. case *map[int]int64:
  489. fastpathTV.EncMapIntInt64V(*v, e)
  490. case map[int]float32:
  491. fastpathTV.EncMapIntFloat32V(v, e)
  492. case *map[int]float32:
  493. fastpathTV.EncMapIntFloat32V(*v, e)
  494. case map[int]float64:
  495. fastpathTV.EncMapIntFloat64V(v, e)
  496. case *map[int]float64:
  497. fastpathTV.EncMapIntFloat64V(*v, e)
  498. case map[int]bool:
  499. fastpathTV.EncMapIntBoolV(v, e)
  500. case *map[int]bool:
  501. fastpathTV.EncMapIntBoolV(*v, e)
  502. case map[int64]interface{}:
  503. fastpathTV.EncMapInt64IntfV(v, e)
  504. case *map[int64]interface{}:
  505. fastpathTV.EncMapInt64IntfV(*v, e)
  506. case map[int64]string:
  507. fastpathTV.EncMapInt64StringV(v, e)
  508. case *map[int64]string:
  509. fastpathTV.EncMapInt64StringV(*v, e)
  510. case map[int64]uint:
  511. fastpathTV.EncMapInt64UintV(v, e)
  512. case *map[int64]uint:
  513. fastpathTV.EncMapInt64UintV(*v, e)
  514. case map[int64]uint8:
  515. fastpathTV.EncMapInt64Uint8V(v, e)
  516. case *map[int64]uint8:
  517. fastpathTV.EncMapInt64Uint8V(*v, e)
  518. case map[int64]uint64:
  519. fastpathTV.EncMapInt64Uint64V(v, e)
  520. case *map[int64]uint64:
  521. fastpathTV.EncMapInt64Uint64V(*v, e)
  522. case map[int64]uintptr:
  523. fastpathTV.EncMapInt64UintptrV(v, e)
  524. case *map[int64]uintptr:
  525. fastpathTV.EncMapInt64UintptrV(*v, e)
  526. case map[int64]int:
  527. fastpathTV.EncMapInt64IntV(v, e)
  528. case *map[int64]int:
  529. fastpathTV.EncMapInt64IntV(*v, e)
  530. case map[int64]int64:
  531. fastpathTV.EncMapInt64Int64V(v, e)
  532. case *map[int64]int64:
  533. fastpathTV.EncMapInt64Int64V(*v, e)
  534. case map[int64]float32:
  535. fastpathTV.EncMapInt64Float32V(v, e)
  536. case *map[int64]float32:
  537. fastpathTV.EncMapInt64Float32V(*v, e)
  538. case map[int64]float64:
  539. fastpathTV.EncMapInt64Float64V(v, e)
  540. case *map[int64]float64:
  541. fastpathTV.EncMapInt64Float64V(*v, e)
  542. case map[int64]bool:
  543. fastpathTV.EncMapInt64BoolV(v, e)
  544. case *map[int64]bool:
  545. fastpathTV.EncMapInt64BoolV(*v, e)
  546. default:
  547. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  548. return false
  549. }
  550. return true
  551. }
  552. // -- -- fast path functions
  553. func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  554. if f.ti.mbs {
  555. fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e)
  556. } else {
  557. fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e)
  558. }
  559. }
  560. func (_ fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) {
  561. if v == nil {
  562. e.e.EncodeNil()
  563. return
  564. }
  565. ee, esep := e.e, e.hh.hasElemSeparators()
  566. ee.WriteArrayStart(len(v))
  567. for _, v2 := range v {
  568. if esep {
  569. ee.WriteArrayElem()
  570. }
  571. e.encode(v2)
  572. }
  573. ee.WriteArrayEnd()
  574. }
  575. func (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) {
  576. ee, esep := e.e, e.hh.hasElemSeparators()
  577. if len(v)%2 == 1 {
  578. e.errorf(fastpathMapBySliceErrMsg, len(v))
  579. return
  580. }
  581. ee.WriteMapStart(len(v) / 2)
  582. for j, v2 := range v {
  583. if esep {
  584. if j%2 == 0 {
  585. ee.WriteMapElemKey()
  586. } else {
  587. ee.WriteMapElemValue()
  588. }
  589. }
  590. e.encode(v2)
  591. }
  592. ee.WriteMapEnd()
  593. }
  594. func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) {
  595. if f.ti.mbs {
  596. fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e)
  597. } else {
  598. fastpathTV.EncSliceStringV(rv2i(rv).([]string), e)
  599. }
  600. }
  601. func (_ fastpathT) EncSliceStringV(v []string, e *Encoder) {
  602. if v == nil {
  603. e.e.EncodeNil()
  604. return
  605. }
  606. ee, esep := e.e, e.hh.hasElemSeparators()
  607. ee.WriteArrayStart(len(v))
  608. for _, v2 := range v {
  609. if esep {
  610. ee.WriteArrayElem()
  611. }
  612. if e.h.StringToRaw {
  613. ee.EncodeStringBytesRaw(bytesView(v2))
  614. } else {
  615. ee.EncodeStringEnc(cUTF8, v2)
  616. }
  617. }
  618. ee.WriteArrayEnd()
  619. }
  620. func (_ fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) {
  621. ee, esep := e.e, e.hh.hasElemSeparators()
  622. if len(v)%2 == 1 {
  623. e.errorf(fastpathMapBySliceErrMsg, len(v))
  624. return
  625. }
  626. ee.WriteMapStart(len(v) / 2)
  627. for j, v2 := range v {
  628. if esep {
  629. if j%2 == 0 {
  630. ee.WriteMapElemKey()
  631. } else {
  632. ee.WriteMapElemValue()
  633. }
  634. }
  635. if e.h.StringToRaw {
  636. ee.EncodeStringBytesRaw(bytesView(v2))
  637. } else {
  638. ee.EncodeStringEnc(cUTF8, v2)
  639. }
  640. }
  641. ee.WriteMapEnd()
  642. }
  643. func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  644. if f.ti.mbs {
  645. fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e)
  646. } else {
  647. fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e)
  648. }
  649. }
  650. func (_ fastpathT) EncSliceFloat32V(v []float32, e *Encoder) {
  651. if v == nil {
  652. e.e.EncodeNil()
  653. return
  654. }
  655. ee, esep := e.e, e.hh.hasElemSeparators()
  656. ee.WriteArrayStart(len(v))
  657. for _, v2 := range v {
  658. if esep {
  659. ee.WriteArrayElem()
  660. }
  661. ee.EncodeFloat32(v2)
  662. }
  663. ee.WriteArrayEnd()
  664. }
  665. func (_ fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) {
  666. ee, esep := e.e, e.hh.hasElemSeparators()
  667. if len(v)%2 == 1 {
  668. e.errorf(fastpathMapBySliceErrMsg, len(v))
  669. return
  670. }
  671. ee.WriteMapStart(len(v) / 2)
  672. for j, v2 := range v {
  673. if esep {
  674. if j%2 == 0 {
  675. ee.WriteMapElemKey()
  676. } else {
  677. ee.WriteMapElemValue()
  678. }
  679. }
  680. ee.EncodeFloat32(v2)
  681. }
  682. ee.WriteMapEnd()
  683. }
  684. func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  685. if f.ti.mbs {
  686. fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e)
  687. } else {
  688. fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e)
  689. }
  690. }
  691. func (_ fastpathT) EncSliceFloat64V(v []float64, e *Encoder) {
  692. if v == nil {
  693. e.e.EncodeNil()
  694. return
  695. }
  696. ee, esep := e.e, e.hh.hasElemSeparators()
  697. ee.WriteArrayStart(len(v))
  698. for _, v2 := range v {
  699. if esep {
  700. ee.WriteArrayElem()
  701. }
  702. ee.EncodeFloat64(v2)
  703. }
  704. ee.WriteArrayEnd()
  705. }
  706. func (_ fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) {
  707. ee, esep := e.e, e.hh.hasElemSeparators()
  708. if len(v)%2 == 1 {
  709. e.errorf(fastpathMapBySliceErrMsg, len(v))
  710. return
  711. }
  712. ee.WriteMapStart(len(v) / 2)
  713. for j, v2 := range v {
  714. if esep {
  715. if j%2 == 0 {
  716. ee.WriteMapElemKey()
  717. } else {
  718. ee.WriteMapElemValue()
  719. }
  720. }
  721. ee.EncodeFloat64(v2)
  722. }
  723. ee.WriteMapEnd()
  724. }
  725. func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) {
  726. if f.ti.mbs {
  727. fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e)
  728. } else {
  729. fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e)
  730. }
  731. }
  732. func (_ fastpathT) EncSliceUintV(v []uint, e *Encoder) {
  733. if v == nil {
  734. e.e.EncodeNil()
  735. return
  736. }
  737. ee, esep := e.e, e.hh.hasElemSeparators()
  738. ee.WriteArrayStart(len(v))
  739. for _, v2 := range v {
  740. if esep {
  741. ee.WriteArrayElem()
  742. }
  743. ee.EncodeUint(uint64(v2))
  744. }
  745. ee.WriteArrayEnd()
  746. }
  747. func (_ fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) {
  748. ee, esep := e.e, e.hh.hasElemSeparators()
  749. if len(v)%2 == 1 {
  750. e.errorf(fastpathMapBySliceErrMsg, len(v))
  751. return
  752. }
  753. ee.WriteMapStart(len(v) / 2)
  754. for j, v2 := range v {
  755. if esep {
  756. if j%2 == 0 {
  757. ee.WriteMapElemKey()
  758. } else {
  759. ee.WriteMapElemValue()
  760. }
  761. }
  762. ee.EncodeUint(uint64(v2))
  763. }
  764. ee.WriteMapEnd()
  765. }
  766. func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) {
  767. if f.ti.mbs {
  768. fastpathTV.EncAsMapSliceUint8V(rv2i(rv).([]uint8), e)
  769. } else {
  770. fastpathTV.EncSliceUint8V(rv2i(rv).([]uint8), e)
  771. }
  772. }
  773. func (_ fastpathT) EncSliceUint8V(v []uint8, e *Encoder) {
  774. if v == nil {
  775. e.e.EncodeNil()
  776. return
  777. }
  778. ee, esep := e.e, e.hh.hasElemSeparators()
  779. ee.WriteArrayStart(len(v))
  780. for _, v2 := range v {
  781. if esep {
  782. ee.WriteArrayElem()
  783. }
  784. ee.EncodeUint(uint64(v2))
  785. }
  786. ee.WriteArrayEnd()
  787. }
  788. func (_ fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) {
  789. ee, esep := e.e, e.hh.hasElemSeparators()
  790. if len(v)%2 == 1 {
  791. e.errorf(fastpathMapBySliceErrMsg, len(v))
  792. return
  793. }
  794. ee.WriteMapStart(len(v) / 2)
  795. for j, v2 := range v {
  796. if esep {
  797. if j%2 == 0 {
  798. ee.WriteMapElemKey()
  799. } else {
  800. ee.WriteMapElemValue()
  801. }
  802. }
  803. ee.EncodeUint(uint64(v2))
  804. }
  805. ee.WriteMapEnd()
  806. }
  807. func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  808. if f.ti.mbs {
  809. fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e)
  810. } else {
  811. fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e)
  812. }
  813. }
  814. func (_ fastpathT) EncSliceUint16V(v []uint16, e *Encoder) {
  815. if v == nil {
  816. e.e.EncodeNil()
  817. return
  818. }
  819. ee, esep := e.e, e.hh.hasElemSeparators()
  820. ee.WriteArrayStart(len(v))
  821. for _, v2 := range v {
  822. if esep {
  823. ee.WriteArrayElem()
  824. }
  825. ee.EncodeUint(uint64(v2))
  826. }
  827. ee.WriteArrayEnd()
  828. }
  829. func (_ fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) {
  830. ee, esep := e.e, e.hh.hasElemSeparators()
  831. if len(v)%2 == 1 {
  832. e.errorf(fastpathMapBySliceErrMsg, len(v))
  833. return
  834. }
  835. ee.WriteMapStart(len(v) / 2)
  836. for j, v2 := range v {
  837. if esep {
  838. if j%2 == 0 {
  839. ee.WriteMapElemKey()
  840. } else {
  841. ee.WriteMapElemValue()
  842. }
  843. }
  844. ee.EncodeUint(uint64(v2))
  845. }
  846. ee.WriteMapEnd()
  847. }
  848. func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  849. if f.ti.mbs {
  850. fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e)
  851. } else {
  852. fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e)
  853. }
  854. }
  855. func (_ fastpathT) EncSliceUint32V(v []uint32, e *Encoder) {
  856. if v == nil {
  857. e.e.EncodeNil()
  858. return
  859. }
  860. ee, esep := e.e, e.hh.hasElemSeparators()
  861. ee.WriteArrayStart(len(v))
  862. for _, v2 := range v {
  863. if esep {
  864. ee.WriteArrayElem()
  865. }
  866. ee.EncodeUint(uint64(v2))
  867. }
  868. ee.WriteArrayEnd()
  869. }
  870. func (_ fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) {
  871. ee, esep := e.e, e.hh.hasElemSeparators()
  872. if len(v)%2 == 1 {
  873. e.errorf(fastpathMapBySliceErrMsg, len(v))
  874. return
  875. }
  876. ee.WriteMapStart(len(v) / 2)
  877. for j, v2 := range v {
  878. if esep {
  879. if j%2 == 0 {
  880. ee.WriteMapElemKey()
  881. } else {
  882. ee.WriteMapElemValue()
  883. }
  884. }
  885. ee.EncodeUint(uint64(v2))
  886. }
  887. ee.WriteMapEnd()
  888. }
  889. func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  890. if f.ti.mbs {
  891. fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e)
  892. } else {
  893. fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e)
  894. }
  895. }
  896. func (_ fastpathT) EncSliceUint64V(v []uint64, e *Encoder) {
  897. if v == nil {
  898. e.e.EncodeNil()
  899. return
  900. }
  901. ee, esep := e.e, e.hh.hasElemSeparators()
  902. ee.WriteArrayStart(len(v))
  903. for _, v2 := range v {
  904. if esep {
  905. ee.WriteArrayElem()
  906. }
  907. ee.EncodeUint(v2)
  908. }
  909. ee.WriteArrayEnd()
  910. }
  911. func (_ fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) {
  912. ee, esep := e.e, e.hh.hasElemSeparators()
  913. if len(v)%2 == 1 {
  914. e.errorf(fastpathMapBySliceErrMsg, len(v))
  915. return
  916. }
  917. ee.WriteMapStart(len(v) / 2)
  918. for j, v2 := range v {
  919. if esep {
  920. if j%2 == 0 {
  921. ee.WriteMapElemKey()
  922. } else {
  923. ee.WriteMapElemValue()
  924. }
  925. }
  926. ee.EncodeUint(v2)
  927. }
  928. ee.WriteMapEnd()
  929. }
  930. func (e *Encoder) fastpathEncSliceUintptrR(f *codecFnInfo, rv reflect.Value) {
  931. if f.ti.mbs {
  932. fastpathTV.EncAsMapSliceUintptrV(rv2i(rv).([]uintptr), e)
  933. } else {
  934. fastpathTV.EncSliceUintptrV(rv2i(rv).([]uintptr), e)
  935. }
  936. }
  937. func (_ fastpathT) EncSliceUintptrV(v []uintptr, e *Encoder) {
  938. if v == nil {
  939. e.e.EncodeNil()
  940. return
  941. }
  942. ee, esep := e.e, e.hh.hasElemSeparators()
  943. ee.WriteArrayStart(len(v))
  944. for _, v2 := range v {
  945. if esep {
  946. ee.WriteArrayElem()
  947. }
  948. e.encode(v2)
  949. }
  950. ee.WriteArrayEnd()
  951. }
  952. func (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, e *Encoder) {
  953. ee, esep := e.e, e.hh.hasElemSeparators()
  954. if len(v)%2 == 1 {
  955. e.errorf(fastpathMapBySliceErrMsg, len(v))
  956. return
  957. }
  958. ee.WriteMapStart(len(v) / 2)
  959. for j, v2 := range v {
  960. if esep {
  961. if j%2 == 0 {
  962. ee.WriteMapElemKey()
  963. } else {
  964. ee.WriteMapElemValue()
  965. }
  966. }
  967. e.encode(v2)
  968. }
  969. ee.WriteMapEnd()
  970. }
  971. func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) {
  972. if f.ti.mbs {
  973. fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e)
  974. } else {
  975. fastpathTV.EncSliceIntV(rv2i(rv).([]int), e)
  976. }
  977. }
  978. func (_ fastpathT) EncSliceIntV(v []int, e *Encoder) {
  979. if v == nil {
  980. e.e.EncodeNil()
  981. return
  982. }
  983. ee, esep := e.e, e.hh.hasElemSeparators()
  984. ee.WriteArrayStart(len(v))
  985. for _, v2 := range v {
  986. if esep {
  987. ee.WriteArrayElem()
  988. }
  989. ee.EncodeInt(int64(v2))
  990. }
  991. ee.WriteArrayEnd()
  992. }
  993. func (_ fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) {
  994. ee, esep := e.e, e.hh.hasElemSeparators()
  995. if len(v)%2 == 1 {
  996. e.errorf(fastpathMapBySliceErrMsg, len(v))
  997. return
  998. }
  999. ee.WriteMapStart(len(v) / 2)
  1000. for j, v2 := range v {
  1001. if esep {
  1002. if j%2 == 0 {
  1003. ee.WriteMapElemKey()
  1004. } else {
  1005. ee.WriteMapElemValue()
  1006. }
  1007. }
  1008. ee.EncodeInt(int64(v2))
  1009. }
  1010. ee.WriteMapEnd()
  1011. }
  1012. func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  1013. if f.ti.mbs {
  1014. fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e)
  1015. } else {
  1016. fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e)
  1017. }
  1018. }
  1019. func (_ fastpathT) EncSliceInt8V(v []int8, e *Encoder) {
  1020. if v == nil {
  1021. e.e.EncodeNil()
  1022. return
  1023. }
  1024. ee, esep := e.e, e.hh.hasElemSeparators()
  1025. ee.WriteArrayStart(len(v))
  1026. for _, v2 := range v {
  1027. if esep {
  1028. ee.WriteArrayElem()
  1029. }
  1030. ee.EncodeInt(int64(v2))
  1031. }
  1032. ee.WriteArrayEnd()
  1033. }
  1034. func (_ fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) {
  1035. ee, esep := e.e, e.hh.hasElemSeparators()
  1036. if len(v)%2 == 1 {
  1037. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1038. return
  1039. }
  1040. ee.WriteMapStart(len(v) / 2)
  1041. for j, v2 := range v {
  1042. if esep {
  1043. if j%2 == 0 {
  1044. ee.WriteMapElemKey()
  1045. } else {
  1046. ee.WriteMapElemValue()
  1047. }
  1048. }
  1049. ee.EncodeInt(int64(v2))
  1050. }
  1051. ee.WriteMapEnd()
  1052. }
  1053. func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  1054. if f.ti.mbs {
  1055. fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e)
  1056. } else {
  1057. fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e)
  1058. }
  1059. }
  1060. func (_ fastpathT) EncSliceInt16V(v []int16, e *Encoder) {
  1061. if v == nil {
  1062. e.e.EncodeNil()
  1063. return
  1064. }
  1065. ee, esep := e.e, e.hh.hasElemSeparators()
  1066. ee.WriteArrayStart(len(v))
  1067. for _, v2 := range v {
  1068. if esep {
  1069. ee.WriteArrayElem()
  1070. }
  1071. ee.EncodeInt(int64(v2))
  1072. }
  1073. ee.WriteArrayEnd()
  1074. }
  1075. func (_ fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) {
  1076. ee, esep := e.e, e.hh.hasElemSeparators()
  1077. if len(v)%2 == 1 {
  1078. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1079. return
  1080. }
  1081. ee.WriteMapStart(len(v) / 2)
  1082. for j, v2 := range v {
  1083. if esep {
  1084. if j%2 == 0 {
  1085. ee.WriteMapElemKey()
  1086. } else {
  1087. ee.WriteMapElemValue()
  1088. }
  1089. }
  1090. ee.EncodeInt(int64(v2))
  1091. }
  1092. ee.WriteMapEnd()
  1093. }
  1094. func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  1095. if f.ti.mbs {
  1096. fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e)
  1097. } else {
  1098. fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e)
  1099. }
  1100. }
  1101. func (_ fastpathT) EncSliceInt32V(v []int32, e *Encoder) {
  1102. if v == nil {
  1103. e.e.EncodeNil()
  1104. return
  1105. }
  1106. ee, esep := e.e, e.hh.hasElemSeparators()
  1107. ee.WriteArrayStart(len(v))
  1108. for _, v2 := range v {
  1109. if esep {
  1110. ee.WriteArrayElem()
  1111. }
  1112. ee.EncodeInt(int64(v2))
  1113. }
  1114. ee.WriteArrayEnd()
  1115. }
  1116. func (_ fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) {
  1117. ee, esep := e.e, e.hh.hasElemSeparators()
  1118. if len(v)%2 == 1 {
  1119. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1120. return
  1121. }
  1122. ee.WriteMapStart(len(v) / 2)
  1123. for j, v2 := range v {
  1124. if esep {
  1125. if j%2 == 0 {
  1126. ee.WriteMapElemKey()
  1127. } else {
  1128. ee.WriteMapElemValue()
  1129. }
  1130. }
  1131. ee.EncodeInt(int64(v2))
  1132. }
  1133. ee.WriteMapEnd()
  1134. }
  1135. func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  1136. if f.ti.mbs {
  1137. fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e)
  1138. } else {
  1139. fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e)
  1140. }
  1141. }
  1142. func (_ fastpathT) EncSliceInt64V(v []int64, e *Encoder) {
  1143. if v == nil {
  1144. e.e.EncodeNil()
  1145. return
  1146. }
  1147. ee, esep := e.e, e.hh.hasElemSeparators()
  1148. ee.WriteArrayStart(len(v))
  1149. for _, v2 := range v {
  1150. if esep {
  1151. ee.WriteArrayElem()
  1152. }
  1153. ee.EncodeInt(v2)
  1154. }
  1155. ee.WriteArrayEnd()
  1156. }
  1157. func (_ fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) {
  1158. ee, esep := e.e, e.hh.hasElemSeparators()
  1159. if len(v)%2 == 1 {
  1160. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1161. return
  1162. }
  1163. ee.WriteMapStart(len(v) / 2)
  1164. for j, v2 := range v {
  1165. if esep {
  1166. if j%2 == 0 {
  1167. ee.WriteMapElemKey()
  1168. } else {
  1169. ee.WriteMapElemValue()
  1170. }
  1171. }
  1172. ee.EncodeInt(v2)
  1173. }
  1174. ee.WriteMapEnd()
  1175. }
  1176. func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  1177. if f.ti.mbs {
  1178. fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e)
  1179. } else {
  1180. fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e)
  1181. }
  1182. }
  1183. func (_ fastpathT) EncSliceBoolV(v []bool, e *Encoder) {
  1184. if v == nil {
  1185. e.e.EncodeNil()
  1186. return
  1187. }
  1188. ee, esep := e.e, e.hh.hasElemSeparators()
  1189. ee.WriteArrayStart(len(v))
  1190. for _, v2 := range v {
  1191. if esep {
  1192. ee.WriteArrayElem()
  1193. }
  1194. ee.EncodeBool(v2)
  1195. }
  1196. ee.WriteArrayEnd()
  1197. }
  1198. func (_ fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) {
  1199. ee, esep := e.e, e.hh.hasElemSeparators()
  1200. if len(v)%2 == 1 {
  1201. e.errorf(fastpathMapBySliceErrMsg, len(v))
  1202. return
  1203. }
  1204. ee.WriteMapStart(len(v) / 2)
  1205. for j, v2 := range v {
  1206. if esep {
  1207. if j%2 == 0 {
  1208. ee.WriteMapElemKey()
  1209. } else {
  1210. ee.WriteMapElemValue()
  1211. }
  1212. }
  1213. ee.EncodeBool(v2)
  1214. }
  1215. ee.WriteMapEnd()
  1216. }
  1217. func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  1218. fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e)
  1219. }
  1220. func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) {
  1221. if v == nil {
  1222. e.e.EncodeNil()
  1223. return
  1224. }
  1225. ee, esep := e.e, e.hh.hasElemSeparators()
  1226. ee.WriteMapStart(len(v))
  1227. if e.h.Canonical {
  1228. v2 := make([]string, len(v))
  1229. var i uint
  1230. for k := range v {
  1231. v2[i] = k
  1232. i++
  1233. }
  1234. sort.Sort(stringSlice(v2))
  1235. for _, k2 := range v2 {
  1236. if esep {
  1237. ee.WriteMapElemKey()
  1238. }
  1239. if e.h.StringToRaw {
  1240. ee.EncodeStringBytesRaw(bytesView(k2))
  1241. } else {
  1242. ee.EncodeStringEnc(cUTF8, k2)
  1243. }
  1244. if esep {
  1245. ee.WriteMapElemValue()
  1246. }
  1247. e.encode(v[k2])
  1248. }
  1249. } else {
  1250. for k2, v2 := range v {
  1251. if esep {
  1252. ee.WriteMapElemKey()
  1253. }
  1254. if e.h.StringToRaw {
  1255. ee.EncodeStringBytesRaw(bytesView(k2))
  1256. } else {
  1257. ee.EncodeStringEnc(cUTF8, k2)
  1258. }
  1259. if esep {
  1260. ee.WriteMapElemValue()
  1261. }
  1262. e.encode(v2)
  1263. }
  1264. }
  1265. ee.WriteMapEnd()
  1266. }
  1267. func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  1268. fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e)
  1269. }
  1270. func (_ fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) {
  1271. if v == nil {
  1272. e.e.EncodeNil()
  1273. return
  1274. }
  1275. ee, esep := e.e, e.hh.hasElemSeparators()
  1276. ee.WriteMapStart(len(v))
  1277. if e.h.Canonical {
  1278. v2 := make([]string, len(v))
  1279. var i uint
  1280. for k := range v {
  1281. v2[i] = k
  1282. i++
  1283. }
  1284. sort.Sort(stringSlice(v2))
  1285. for _, k2 := range v2 {
  1286. if esep {
  1287. ee.WriteMapElemKey()
  1288. }
  1289. if e.h.StringToRaw {
  1290. ee.EncodeStringBytesRaw(bytesView(k2))
  1291. } else {
  1292. ee.EncodeStringEnc(cUTF8, k2)
  1293. }
  1294. if esep {
  1295. ee.WriteMapElemValue()
  1296. }
  1297. if e.h.StringToRaw {
  1298. ee.EncodeStringBytesRaw(bytesView(v[k2]))
  1299. } else {
  1300. ee.EncodeStringEnc(cUTF8, v[k2])
  1301. }
  1302. }
  1303. } else {
  1304. for k2, v2 := range v {
  1305. if esep {
  1306. ee.WriteMapElemKey()
  1307. }
  1308. if e.h.StringToRaw {
  1309. ee.EncodeStringBytesRaw(bytesView(k2))
  1310. } else {
  1311. ee.EncodeStringEnc(cUTF8, k2)
  1312. }
  1313. if esep {
  1314. ee.WriteMapElemValue()
  1315. }
  1316. if e.h.StringToRaw {
  1317. ee.EncodeStringBytesRaw(bytesView(v2))
  1318. } else {
  1319. ee.EncodeStringEnc(cUTF8, v2)
  1320. }
  1321. }
  1322. }
  1323. ee.WriteMapEnd()
  1324. }
  1325. func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  1326. fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e)
  1327. }
  1328. func (_ fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) {
  1329. if v == nil {
  1330. e.e.EncodeNil()
  1331. return
  1332. }
  1333. ee, esep := e.e, e.hh.hasElemSeparators()
  1334. ee.WriteMapStart(len(v))
  1335. if e.h.Canonical {
  1336. v2 := make([]string, len(v))
  1337. var i uint
  1338. for k := range v {
  1339. v2[i] = k
  1340. i++
  1341. }
  1342. sort.Sort(stringSlice(v2))
  1343. for _, k2 := range v2 {
  1344. if esep {
  1345. ee.WriteMapElemKey()
  1346. }
  1347. if e.h.StringToRaw {
  1348. ee.EncodeStringBytesRaw(bytesView(k2))
  1349. } else {
  1350. ee.EncodeStringEnc(cUTF8, k2)
  1351. }
  1352. if esep {
  1353. ee.WriteMapElemValue()
  1354. }
  1355. ee.EncodeUint(uint64(v[k2]))
  1356. }
  1357. } else {
  1358. for k2, v2 := range v {
  1359. if esep {
  1360. ee.WriteMapElemKey()
  1361. }
  1362. if e.h.StringToRaw {
  1363. ee.EncodeStringBytesRaw(bytesView(k2))
  1364. } else {
  1365. ee.EncodeStringEnc(cUTF8, k2)
  1366. }
  1367. if esep {
  1368. ee.WriteMapElemValue()
  1369. }
  1370. ee.EncodeUint(uint64(v2))
  1371. }
  1372. }
  1373. ee.WriteMapEnd()
  1374. }
  1375. func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  1376. fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e)
  1377. }
  1378. func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) {
  1379. if v == nil {
  1380. e.e.EncodeNil()
  1381. return
  1382. }
  1383. ee, esep := e.e, e.hh.hasElemSeparators()
  1384. ee.WriteMapStart(len(v))
  1385. if e.h.Canonical {
  1386. v2 := make([]string, len(v))
  1387. var i uint
  1388. for k := range v {
  1389. v2[i] = k
  1390. i++
  1391. }
  1392. sort.Sort(stringSlice(v2))
  1393. for _, k2 := range v2 {
  1394. if esep {
  1395. ee.WriteMapElemKey()
  1396. }
  1397. if e.h.StringToRaw {
  1398. ee.EncodeStringBytesRaw(bytesView(k2))
  1399. } else {
  1400. ee.EncodeStringEnc(cUTF8, k2)
  1401. }
  1402. if esep {
  1403. ee.WriteMapElemValue()
  1404. }
  1405. ee.EncodeUint(uint64(v[k2]))
  1406. }
  1407. } else {
  1408. for k2, v2 := range v {
  1409. if esep {
  1410. ee.WriteMapElemKey()
  1411. }
  1412. if e.h.StringToRaw {
  1413. ee.EncodeStringBytesRaw(bytesView(k2))
  1414. } else {
  1415. ee.EncodeStringEnc(cUTF8, k2)
  1416. }
  1417. if esep {
  1418. ee.WriteMapElemValue()
  1419. }
  1420. ee.EncodeUint(uint64(v2))
  1421. }
  1422. }
  1423. ee.WriteMapEnd()
  1424. }
  1425. func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  1426. fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e)
  1427. }
  1428. func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) {
  1429. if v == nil {
  1430. e.e.EncodeNil()
  1431. return
  1432. }
  1433. ee, esep := e.e, e.hh.hasElemSeparators()
  1434. ee.WriteMapStart(len(v))
  1435. if e.h.Canonical {
  1436. v2 := make([]string, len(v))
  1437. var i uint
  1438. for k := range v {
  1439. v2[i] = k
  1440. i++
  1441. }
  1442. sort.Sort(stringSlice(v2))
  1443. for _, k2 := range v2 {
  1444. if esep {
  1445. ee.WriteMapElemKey()
  1446. }
  1447. if e.h.StringToRaw {
  1448. ee.EncodeStringBytesRaw(bytesView(k2))
  1449. } else {
  1450. ee.EncodeStringEnc(cUTF8, k2)
  1451. }
  1452. if esep {
  1453. ee.WriteMapElemValue()
  1454. }
  1455. ee.EncodeUint(v[k2])
  1456. }
  1457. } else {
  1458. for k2, v2 := range v {
  1459. if esep {
  1460. ee.WriteMapElemKey()
  1461. }
  1462. if e.h.StringToRaw {
  1463. ee.EncodeStringBytesRaw(bytesView(k2))
  1464. } else {
  1465. ee.EncodeStringEnc(cUTF8, k2)
  1466. }
  1467. if esep {
  1468. ee.WriteMapElemValue()
  1469. }
  1470. ee.EncodeUint(v2)
  1471. }
  1472. }
  1473. ee.WriteMapEnd()
  1474. }
  1475. func (e *Encoder) fastpathEncMapStringUintptrR(f *codecFnInfo, rv reflect.Value) {
  1476. fastpathTV.EncMapStringUintptrV(rv2i(rv).(map[string]uintptr), e)
  1477. }
  1478. func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, e *Encoder) {
  1479. if v == nil {
  1480. e.e.EncodeNil()
  1481. return
  1482. }
  1483. ee, esep := e.e, e.hh.hasElemSeparators()
  1484. ee.WriteMapStart(len(v))
  1485. if e.h.Canonical {
  1486. v2 := make([]string, len(v))
  1487. var i uint
  1488. for k := range v {
  1489. v2[i] = k
  1490. i++
  1491. }
  1492. sort.Sort(stringSlice(v2))
  1493. for _, k2 := range v2 {
  1494. if esep {
  1495. ee.WriteMapElemKey()
  1496. }
  1497. if e.h.StringToRaw {
  1498. ee.EncodeStringBytesRaw(bytesView(k2))
  1499. } else {
  1500. ee.EncodeStringEnc(cUTF8, k2)
  1501. }
  1502. if esep {
  1503. ee.WriteMapElemValue()
  1504. }
  1505. e.encode(v[k2])
  1506. }
  1507. } else {
  1508. for k2, v2 := range v {
  1509. if esep {
  1510. ee.WriteMapElemKey()
  1511. }
  1512. if e.h.StringToRaw {
  1513. ee.EncodeStringBytesRaw(bytesView(k2))
  1514. } else {
  1515. ee.EncodeStringEnc(cUTF8, k2)
  1516. }
  1517. if esep {
  1518. ee.WriteMapElemValue()
  1519. }
  1520. e.encode(v2)
  1521. }
  1522. }
  1523. ee.WriteMapEnd()
  1524. }
  1525. func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  1526. fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e)
  1527. }
  1528. func (_ fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) {
  1529. if v == nil {
  1530. e.e.EncodeNil()
  1531. return
  1532. }
  1533. ee, esep := e.e, e.hh.hasElemSeparators()
  1534. ee.WriteMapStart(len(v))
  1535. if e.h.Canonical {
  1536. v2 := make([]string, len(v))
  1537. var i uint
  1538. for k := range v {
  1539. v2[i] = k
  1540. i++
  1541. }
  1542. sort.Sort(stringSlice(v2))
  1543. for _, k2 := range v2 {
  1544. if esep {
  1545. ee.WriteMapElemKey()
  1546. }
  1547. if e.h.StringToRaw {
  1548. ee.EncodeStringBytesRaw(bytesView(k2))
  1549. } else {
  1550. ee.EncodeStringEnc(cUTF8, k2)
  1551. }
  1552. if esep {
  1553. ee.WriteMapElemValue()
  1554. }
  1555. ee.EncodeInt(int64(v[k2]))
  1556. }
  1557. } else {
  1558. for k2, v2 := range v {
  1559. if esep {
  1560. ee.WriteMapElemKey()
  1561. }
  1562. if e.h.StringToRaw {
  1563. ee.EncodeStringBytesRaw(bytesView(k2))
  1564. } else {
  1565. ee.EncodeStringEnc(cUTF8, k2)
  1566. }
  1567. if esep {
  1568. ee.WriteMapElemValue()
  1569. }
  1570. ee.EncodeInt(int64(v2))
  1571. }
  1572. }
  1573. ee.WriteMapEnd()
  1574. }
  1575. func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  1576. fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e)
  1577. }
  1578. func (_ fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) {
  1579. if v == nil {
  1580. e.e.EncodeNil()
  1581. return
  1582. }
  1583. ee, esep := e.e, e.hh.hasElemSeparators()
  1584. ee.WriteMapStart(len(v))
  1585. if e.h.Canonical {
  1586. v2 := make([]string, len(v))
  1587. var i uint
  1588. for k := range v {
  1589. v2[i] = k
  1590. i++
  1591. }
  1592. sort.Sort(stringSlice(v2))
  1593. for _, k2 := range v2 {
  1594. if esep {
  1595. ee.WriteMapElemKey()
  1596. }
  1597. if e.h.StringToRaw {
  1598. ee.EncodeStringBytesRaw(bytesView(k2))
  1599. } else {
  1600. ee.EncodeStringEnc(cUTF8, k2)
  1601. }
  1602. if esep {
  1603. ee.WriteMapElemValue()
  1604. }
  1605. ee.EncodeInt(v[k2])
  1606. }
  1607. } else {
  1608. for k2, v2 := range v {
  1609. if esep {
  1610. ee.WriteMapElemKey()
  1611. }
  1612. if e.h.StringToRaw {
  1613. ee.EncodeStringBytesRaw(bytesView(k2))
  1614. } else {
  1615. ee.EncodeStringEnc(cUTF8, k2)
  1616. }
  1617. if esep {
  1618. ee.WriteMapElemValue()
  1619. }
  1620. ee.EncodeInt(v2)
  1621. }
  1622. }
  1623. ee.WriteMapEnd()
  1624. }
  1625. func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  1626. fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e)
  1627. }
  1628. func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) {
  1629. if v == nil {
  1630. e.e.EncodeNil()
  1631. return
  1632. }
  1633. ee, esep := e.e, e.hh.hasElemSeparators()
  1634. ee.WriteMapStart(len(v))
  1635. if e.h.Canonical {
  1636. v2 := make([]string, len(v))
  1637. var i uint
  1638. for k := range v {
  1639. v2[i] = k
  1640. i++
  1641. }
  1642. sort.Sort(stringSlice(v2))
  1643. for _, k2 := range v2 {
  1644. if esep {
  1645. ee.WriteMapElemKey()
  1646. }
  1647. if e.h.StringToRaw {
  1648. ee.EncodeStringBytesRaw(bytesView(k2))
  1649. } else {
  1650. ee.EncodeStringEnc(cUTF8, k2)
  1651. }
  1652. if esep {
  1653. ee.WriteMapElemValue()
  1654. }
  1655. ee.EncodeFloat32(v[k2])
  1656. }
  1657. } else {
  1658. for k2, v2 := range v {
  1659. if esep {
  1660. ee.WriteMapElemKey()
  1661. }
  1662. if e.h.StringToRaw {
  1663. ee.EncodeStringBytesRaw(bytesView(k2))
  1664. } else {
  1665. ee.EncodeStringEnc(cUTF8, k2)
  1666. }
  1667. if esep {
  1668. ee.WriteMapElemValue()
  1669. }
  1670. ee.EncodeFloat32(v2)
  1671. }
  1672. }
  1673. ee.WriteMapEnd()
  1674. }
  1675. func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  1676. fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e)
  1677. }
  1678. func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) {
  1679. if v == nil {
  1680. e.e.EncodeNil()
  1681. return
  1682. }
  1683. ee, esep := e.e, e.hh.hasElemSeparators()
  1684. ee.WriteMapStart(len(v))
  1685. if e.h.Canonical {
  1686. v2 := make([]string, len(v))
  1687. var i uint
  1688. for k := range v {
  1689. v2[i] = k
  1690. i++
  1691. }
  1692. sort.Sort(stringSlice(v2))
  1693. for _, k2 := range v2 {
  1694. if esep {
  1695. ee.WriteMapElemKey()
  1696. }
  1697. if e.h.StringToRaw {
  1698. ee.EncodeStringBytesRaw(bytesView(k2))
  1699. } else {
  1700. ee.EncodeStringEnc(cUTF8, k2)
  1701. }
  1702. if esep {
  1703. ee.WriteMapElemValue()
  1704. }
  1705. ee.EncodeFloat64(v[k2])
  1706. }
  1707. } else {
  1708. for k2, v2 := range v {
  1709. if esep {
  1710. ee.WriteMapElemKey()
  1711. }
  1712. if e.h.StringToRaw {
  1713. ee.EncodeStringBytesRaw(bytesView(k2))
  1714. } else {
  1715. ee.EncodeStringEnc(cUTF8, k2)
  1716. }
  1717. if esep {
  1718. ee.WriteMapElemValue()
  1719. }
  1720. ee.EncodeFloat64(v2)
  1721. }
  1722. }
  1723. ee.WriteMapEnd()
  1724. }
  1725. func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  1726. fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e)
  1727. }
  1728. func (_ fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) {
  1729. if v == nil {
  1730. e.e.EncodeNil()
  1731. return
  1732. }
  1733. ee, esep := e.e, e.hh.hasElemSeparators()
  1734. ee.WriteMapStart(len(v))
  1735. if e.h.Canonical {
  1736. v2 := make([]string, len(v))
  1737. var i uint
  1738. for k := range v {
  1739. v2[i] = k
  1740. i++
  1741. }
  1742. sort.Sort(stringSlice(v2))
  1743. for _, k2 := range v2 {
  1744. if esep {
  1745. ee.WriteMapElemKey()
  1746. }
  1747. if e.h.StringToRaw {
  1748. ee.EncodeStringBytesRaw(bytesView(k2))
  1749. } else {
  1750. ee.EncodeStringEnc(cUTF8, k2)
  1751. }
  1752. if esep {
  1753. ee.WriteMapElemValue()
  1754. }
  1755. ee.EncodeBool(v[k2])
  1756. }
  1757. } else {
  1758. for k2, v2 := range v {
  1759. if esep {
  1760. ee.WriteMapElemKey()
  1761. }
  1762. if e.h.StringToRaw {
  1763. ee.EncodeStringBytesRaw(bytesView(k2))
  1764. } else {
  1765. ee.EncodeStringEnc(cUTF8, k2)
  1766. }
  1767. if esep {
  1768. ee.WriteMapElemValue()
  1769. }
  1770. ee.EncodeBool(v2)
  1771. }
  1772. }
  1773. ee.WriteMapEnd()
  1774. }
  1775. func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  1776. fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e)
  1777. }
  1778. func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) {
  1779. if v == nil {
  1780. e.e.EncodeNil()
  1781. return
  1782. }
  1783. ee, esep := e.e, e.hh.hasElemSeparators()
  1784. ee.WriteMapStart(len(v))
  1785. if e.h.Canonical {
  1786. v2 := make([]uint64, len(v))
  1787. var i uint
  1788. for k := range v {
  1789. v2[i] = uint64(k)
  1790. i++
  1791. }
  1792. sort.Sort(uint64Slice(v2))
  1793. for _, k2 := range v2 {
  1794. if esep {
  1795. ee.WriteMapElemKey()
  1796. }
  1797. ee.EncodeUint(uint64(uint(k2)))
  1798. if esep {
  1799. ee.WriteMapElemValue()
  1800. }
  1801. e.encode(v[uint(k2)])
  1802. }
  1803. } else {
  1804. for k2, v2 := range v {
  1805. if esep {
  1806. ee.WriteMapElemKey()
  1807. }
  1808. ee.EncodeUint(uint64(k2))
  1809. if esep {
  1810. ee.WriteMapElemValue()
  1811. }
  1812. e.encode(v2)
  1813. }
  1814. }
  1815. ee.WriteMapEnd()
  1816. }
  1817. func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  1818. fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e)
  1819. }
  1820. func (_ fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) {
  1821. if v == nil {
  1822. e.e.EncodeNil()
  1823. return
  1824. }
  1825. ee, esep := e.e, e.hh.hasElemSeparators()
  1826. ee.WriteMapStart(len(v))
  1827. if e.h.Canonical {
  1828. v2 := make([]uint64, len(v))
  1829. var i uint
  1830. for k := range v {
  1831. v2[i] = uint64(k)
  1832. i++
  1833. }
  1834. sort.Sort(uint64Slice(v2))
  1835. for _, k2 := range v2 {
  1836. if esep {
  1837. ee.WriteMapElemKey()
  1838. }
  1839. ee.EncodeUint(uint64(uint(k2)))
  1840. if esep {
  1841. ee.WriteMapElemValue()
  1842. }
  1843. if e.h.StringToRaw {
  1844. ee.EncodeStringBytesRaw(bytesView(v[uint(k2)]))
  1845. } else {
  1846. ee.EncodeStringEnc(cUTF8, v[uint(k2)])
  1847. }
  1848. }
  1849. } else {
  1850. for k2, v2 := range v {
  1851. if esep {
  1852. ee.WriteMapElemKey()
  1853. }
  1854. ee.EncodeUint(uint64(k2))
  1855. if esep {
  1856. ee.WriteMapElemValue()
  1857. }
  1858. if e.h.StringToRaw {
  1859. ee.EncodeStringBytesRaw(bytesView(v2))
  1860. } else {
  1861. ee.EncodeStringEnc(cUTF8, v2)
  1862. }
  1863. }
  1864. }
  1865. ee.WriteMapEnd()
  1866. }
  1867. func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  1868. fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e)
  1869. }
  1870. func (_ fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) {
  1871. if v == nil {
  1872. e.e.EncodeNil()
  1873. return
  1874. }
  1875. ee, esep := e.e, e.hh.hasElemSeparators()
  1876. ee.WriteMapStart(len(v))
  1877. if e.h.Canonical {
  1878. v2 := make([]uint64, len(v))
  1879. var i uint
  1880. for k := range v {
  1881. v2[i] = uint64(k)
  1882. i++
  1883. }
  1884. sort.Sort(uint64Slice(v2))
  1885. for _, k2 := range v2 {
  1886. if esep {
  1887. ee.WriteMapElemKey()
  1888. }
  1889. ee.EncodeUint(uint64(uint(k2)))
  1890. if esep {
  1891. ee.WriteMapElemValue()
  1892. }
  1893. ee.EncodeUint(uint64(v[uint(k2)]))
  1894. }
  1895. } else {
  1896. for k2, v2 := range v {
  1897. if esep {
  1898. ee.WriteMapElemKey()
  1899. }
  1900. ee.EncodeUint(uint64(k2))
  1901. if esep {
  1902. ee.WriteMapElemValue()
  1903. }
  1904. ee.EncodeUint(uint64(v2))
  1905. }
  1906. }
  1907. ee.WriteMapEnd()
  1908. }
  1909. func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  1910. fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e)
  1911. }
  1912. func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) {
  1913. if v == nil {
  1914. e.e.EncodeNil()
  1915. return
  1916. }
  1917. ee, esep := e.e, e.hh.hasElemSeparators()
  1918. ee.WriteMapStart(len(v))
  1919. if e.h.Canonical {
  1920. v2 := make([]uint64, len(v))
  1921. var i uint
  1922. for k := range v {
  1923. v2[i] = uint64(k)
  1924. i++
  1925. }
  1926. sort.Sort(uint64Slice(v2))
  1927. for _, k2 := range v2 {
  1928. if esep {
  1929. ee.WriteMapElemKey()
  1930. }
  1931. ee.EncodeUint(uint64(uint(k2)))
  1932. if esep {
  1933. ee.WriteMapElemValue()
  1934. }
  1935. ee.EncodeUint(uint64(v[uint(k2)]))
  1936. }
  1937. } else {
  1938. for k2, v2 := range v {
  1939. if esep {
  1940. ee.WriteMapElemKey()
  1941. }
  1942. ee.EncodeUint(uint64(k2))
  1943. if esep {
  1944. ee.WriteMapElemValue()
  1945. }
  1946. ee.EncodeUint(uint64(v2))
  1947. }
  1948. }
  1949. ee.WriteMapEnd()
  1950. }
  1951. func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  1952. fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e)
  1953. }
  1954. func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) {
  1955. if v == nil {
  1956. e.e.EncodeNil()
  1957. return
  1958. }
  1959. ee, esep := e.e, e.hh.hasElemSeparators()
  1960. ee.WriteMapStart(len(v))
  1961. if e.h.Canonical {
  1962. v2 := make([]uint64, len(v))
  1963. var i uint
  1964. for k := range v {
  1965. v2[i] = uint64(k)
  1966. i++
  1967. }
  1968. sort.Sort(uint64Slice(v2))
  1969. for _, k2 := range v2 {
  1970. if esep {
  1971. ee.WriteMapElemKey()
  1972. }
  1973. ee.EncodeUint(uint64(uint(k2)))
  1974. if esep {
  1975. ee.WriteMapElemValue()
  1976. }
  1977. ee.EncodeUint(v[uint(k2)])
  1978. }
  1979. } else {
  1980. for k2, v2 := range v {
  1981. if esep {
  1982. ee.WriteMapElemKey()
  1983. }
  1984. ee.EncodeUint(uint64(k2))
  1985. if esep {
  1986. ee.WriteMapElemValue()
  1987. }
  1988. ee.EncodeUint(v2)
  1989. }
  1990. }
  1991. ee.WriteMapEnd()
  1992. }
  1993. func (e *Encoder) fastpathEncMapUintUintptrR(f *codecFnInfo, rv reflect.Value) {
  1994. fastpathTV.EncMapUintUintptrV(rv2i(rv).(map[uint]uintptr), e)
  1995. }
  1996. func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, e *Encoder) {
  1997. if v == nil {
  1998. e.e.EncodeNil()
  1999. return
  2000. }
  2001. ee, esep := e.e, e.hh.hasElemSeparators()
  2002. ee.WriteMapStart(len(v))
  2003. if e.h.Canonical {
  2004. v2 := make([]uint64, len(v))
  2005. var i uint
  2006. for k := range v {
  2007. v2[i] = uint64(k)
  2008. i++
  2009. }
  2010. sort.Sort(uint64Slice(v2))
  2011. for _, k2 := range v2 {
  2012. if esep {
  2013. ee.WriteMapElemKey()
  2014. }
  2015. ee.EncodeUint(uint64(uint(k2)))
  2016. if esep {
  2017. ee.WriteMapElemValue()
  2018. }
  2019. e.encode(v[uint(k2)])
  2020. }
  2021. } else {
  2022. for k2, v2 := range v {
  2023. if esep {
  2024. ee.WriteMapElemKey()
  2025. }
  2026. ee.EncodeUint(uint64(k2))
  2027. if esep {
  2028. ee.WriteMapElemValue()
  2029. }
  2030. e.encode(v2)
  2031. }
  2032. }
  2033. ee.WriteMapEnd()
  2034. }
  2035. func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  2036. fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e)
  2037. }
  2038. func (_ fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) {
  2039. if v == nil {
  2040. e.e.EncodeNil()
  2041. return
  2042. }
  2043. ee, esep := e.e, e.hh.hasElemSeparators()
  2044. ee.WriteMapStart(len(v))
  2045. if e.h.Canonical {
  2046. v2 := make([]uint64, len(v))
  2047. var i uint
  2048. for k := range v {
  2049. v2[i] = uint64(k)
  2050. i++
  2051. }
  2052. sort.Sort(uint64Slice(v2))
  2053. for _, k2 := range v2 {
  2054. if esep {
  2055. ee.WriteMapElemKey()
  2056. }
  2057. ee.EncodeUint(uint64(uint(k2)))
  2058. if esep {
  2059. ee.WriteMapElemValue()
  2060. }
  2061. ee.EncodeInt(int64(v[uint(k2)]))
  2062. }
  2063. } else {
  2064. for k2, v2 := range v {
  2065. if esep {
  2066. ee.WriteMapElemKey()
  2067. }
  2068. ee.EncodeUint(uint64(k2))
  2069. if esep {
  2070. ee.WriteMapElemValue()
  2071. }
  2072. ee.EncodeInt(int64(v2))
  2073. }
  2074. }
  2075. ee.WriteMapEnd()
  2076. }
  2077. func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  2078. fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e)
  2079. }
  2080. func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) {
  2081. if v == nil {
  2082. e.e.EncodeNil()
  2083. return
  2084. }
  2085. ee, esep := e.e, e.hh.hasElemSeparators()
  2086. ee.WriteMapStart(len(v))
  2087. if e.h.Canonical {
  2088. v2 := make([]uint64, len(v))
  2089. var i uint
  2090. for k := range v {
  2091. v2[i] = uint64(k)
  2092. i++
  2093. }
  2094. sort.Sort(uint64Slice(v2))
  2095. for _, k2 := range v2 {
  2096. if esep {
  2097. ee.WriteMapElemKey()
  2098. }
  2099. ee.EncodeUint(uint64(uint(k2)))
  2100. if esep {
  2101. ee.WriteMapElemValue()
  2102. }
  2103. ee.EncodeInt(v[uint(k2)])
  2104. }
  2105. } else {
  2106. for k2, v2 := range v {
  2107. if esep {
  2108. ee.WriteMapElemKey()
  2109. }
  2110. ee.EncodeUint(uint64(k2))
  2111. if esep {
  2112. ee.WriteMapElemValue()
  2113. }
  2114. ee.EncodeInt(v2)
  2115. }
  2116. }
  2117. ee.WriteMapEnd()
  2118. }
  2119. func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  2120. fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e)
  2121. }
  2122. func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) {
  2123. if v == nil {
  2124. e.e.EncodeNil()
  2125. return
  2126. }
  2127. ee, esep := e.e, e.hh.hasElemSeparators()
  2128. ee.WriteMapStart(len(v))
  2129. if e.h.Canonical {
  2130. v2 := make([]uint64, len(v))
  2131. var i uint
  2132. for k := range v {
  2133. v2[i] = uint64(k)
  2134. i++
  2135. }
  2136. sort.Sort(uint64Slice(v2))
  2137. for _, k2 := range v2 {
  2138. if esep {
  2139. ee.WriteMapElemKey()
  2140. }
  2141. ee.EncodeUint(uint64(uint(k2)))
  2142. if esep {
  2143. ee.WriteMapElemValue()
  2144. }
  2145. ee.EncodeFloat32(v[uint(k2)])
  2146. }
  2147. } else {
  2148. for k2, v2 := range v {
  2149. if esep {
  2150. ee.WriteMapElemKey()
  2151. }
  2152. ee.EncodeUint(uint64(k2))
  2153. if esep {
  2154. ee.WriteMapElemValue()
  2155. }
  2156. ee.EncodeFloat32(v2)
  2157. }
  2158. }
  2159. ee.WriteMapEnd()
  2160. }
  2161. func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  2162. fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e)
  2163. }
  2164. func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) {
  2165. if v == nil {
  2166. e.e.EncodeNil()
  2167. return
  2168. }
  2169. ee, esep := e.e, e.hh.hasElemSeparators()
  2170. ee.WriteMapStart(len(v))
  2171. if e.h.Canonical {
  2172. v2 := make([]uint64, len(v))
  2173. var i uint
  2174. for k := range v {
  2175. v2[i] = uint64(k)
  2176. i++
  2177. }
  2178. sort.Sort(uint64Slice(v2))
  2179. for _, k2 := range v2 {
  2180. if esep {
  2181. ee.WriteMapElemKey()
  2182. }
  2183. ee.EncodeUint(uint64(uint(k2)))
  2184. if esep {
  2185. ee.WriteMapElemValue()
  2186. }
  2187. ee.EncodeFloat64(v[uint(k2)])
  2188. }
  2189. } else {
  2190. for k2, v2 := range v {
  2191. if esep {
  2192. ee.WriteMapElemKey()
  2193. }
  2194. ee.EncodeUint(uint64(k2))
  2195. if esep {
  2196. ee.WriteMapElemValue()
  2197. }
  2198. ee.EncodeFloat64(v2)
  2199. }
  2200. }
  2201. ee.WriteMapEnd()
  2202. }
  2203. func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  2204. fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e)
  2205. }
  2206. func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) {
  2207. if v == nil {
  2208. e.e.EncodeNil()
  2209. return
  2210. }
  2211. ee, esep := e.e, e.hh.hasElemSeparators()
  2212. ee.WriteMapStart(len(v))
  2213. if e.h.Canonical {
  2214. v2 := make([]uint64, len(v))
  2215. var i uint
  2216. for k := range v {
  2217. v2[i] = uint64(k)
  2218. i++
  2219. }
  2220. sort.Sort(uint64Slice(v2))
  2221. for _, k2 := range v2 {
  2222. if esep {
  2223. ee.WriteMapElemKey()
  2224. }
  2225. ee.EncodeUint(uint64(uint(k2)))
  2226. if esep {
  2227. ee.WriteMapElemValue()
  2228. }
  2229. ee.EncodeBool(v[uint(k2)])
  2230. }
  2231. } else {
  2232. for k2, v2 := range v {
  2233. if esep {
  2234. ee.WriteMapElemKey()
  2235. }
  2236. ee.EncodeUint(uint64(k2))
  2237. if esep {
  2238. ee.WriteMapElemValue()
  2239. }
  2240. ee.EncodeBool(v2)
  2241. }
  2242. }
  2243. ee.WriteMapEnd()
  2244. }
  2245. func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  2246. fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e)
  2247. }
  2248. func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) {
  2249. if v == nil {
  2250. e.e.EncodeNil()
  2251. return
  2252. }
  2253. ee, esep := e.e, e.hh.hasElemSeparators()
  2254. ee.WriteMapStart(len(v))
  2255. if e.h.Canonical {
  2256. v2 := make([]uint64, len(v))
  2257. var i uint
  2258. for k := range v {
  2259. v2[i] = uint64(k)
  2260. i++
  2261. }
  2262. sort.Sort(uint64Slice(v2))
  2263. for _, k2 := range v2 {
  2264. if esep {
  2265. ee.WriteMapElemKey()
  2266. }
  2267. ee.EncodeUint(uint64(uint8(k2)))
  2268. if esep {
  2269. ee.WriteMapElemValue()
  2270. }
  2271. e.encode(v[uint8(k2)])
  2272. }
  2273. } else {
  2274. for k2, v2 := range v {
  2275. if esep {
  2276. ee.WriteMapElemKey()
  2277. }
  2278. ee.EncodeUint(uint64(k2))
  2279. if esep {
  2280. ee.WriteMapElemValue()
  2281. }
  2282. e.encode(v2)
  2283. }
  2284. }
  2285. ee.WriteMapEnd()
  2286. }
  2287. func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  2288. fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e)
  2289. }
  2290. func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) {
  2291. if v == nil {
  2292. e.e.EncodeNil()
  2293. return
  2294. }
  2295. ee, esep := e.e, e.hh.hasElemSeparators()
  2296. ee.WriteMapStart(len(v))
  2297. if e.h.Canonical {
  2298. v2 := make([]uint64, len(v))
  2299. var i uint
  2300. for k := range v {
  2301. v2[i] = uint64(k)
  2302. i++
  2303. }
  2304. sort.Sort(uint64Slice(v2))
  2305. for _, k2 := range v2 {
  2306. if esep {
  2307. ee.WriteMapElemKey()
  2308. }
  2309. ee.EncodeUint(uint64(uint8(k2)))
  2310. if esep {
  2311. ee.WriteMapElemValue()
  2312. }
  2313. if e.h.StringToRaw {
  2314. ee.EncodeStringBytesRaw(bytesView(v[uint8(k2)]))
  2315. } else {
  2316. ee.EncodeStringEnc(cUTF8, v[uint8(k2)])
  2317. }
  2318. }
  2319. } else {
  2320. for k2, v2 := range v {
  2321. if esep {
  2322. ee.WriteMapElemKey()
  2323. }
  2324. ee.EncodeUint(uint64(k2))
  2325. if esep {
  2326. ee.WriteMapElemValue()
  2327. }
  2328. if e.h.StringToRaw {
  2329. ee.EncodeStringBytesRaw(bytesView(v2))
  2330. } else {
  2331. ee.EncodeStringEnc(cUTF8, v2)
  2332. }
  2333. }
  2334. }
  2335. ee.WriteMapEnd()
  2336. }
  2337. func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  2338. fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e)
  2339. }
  2340. func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) {
  2341. if v == nil {
  2342. e.e.EncodeNil()
  2343. return
  2344. }
  2345. ee, esep := e.e, e.hh.hasElemSeparators()
  2346. ee.WriteMapStart(len(v))
  2347. if e.h.Canonical {
  2348. v2 := make([]uint64, len(v))
  2349. var i uint
  2350. for k := range v {
  2351. v2[i] = uint64(k)
  2352. i++
  2353. }
  2354. sort.Sort(uint64Slice(v2))
  2355. for _, k2 := range v2 {
  2356. if esep {
  2357. ee.WriteMapElemKey()
  2358. }
  2359. ee.EncodeUint(uint64(uint8(k2)))
  2360. if esep {
  2361. ee.WriteMapElemValue()
  2362. }
  2363. ee.EncodeUint(uint64(v[uint8(k2)]))
  2364. }
  2365. } else {
  2366. for k2, v2 := range v {
  2367. if esep {
  2368. ee.WriteMapElemKey()
  2369. }
  2370. ee.EncodeUint(uint64(k2))
  2371. if esep {
  2372. ee.WriteMapElemValue()
  2373. }
  2374. ee.EncodeUint(uint64(v2))
  2375. }
  2376. }
  2377. ee.WriteMapEnd()
  2378. }
  2379. func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  2380. fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e)
  2381. }
  2382. func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) {
  2383. if v == nil {
  2384. e.e.EncodeNil()
  2385. return
  2386. }
  2387. ee, esep := e.e, e.hh.hasElemSeparators()
  2388. ee.WriteMapStart(len(v))
  2389. if e.h.Canonical {
  2390. v2 := make([]uint64, len(v))
  2391. var i uint
  2392. for k := range v {
  2393. v2[i] = uint64(k)
  2394. i++
  2395. }
  2396. sort.Sort(uint64Slice(v2))
  2397. for _, k2 := range v2 {
  2398. if esep {
  2399. ee.WriteMapElemKey()
  2400. }
  2401. ee.EncodeUint(uint64(uint8(k2)))
  2402. if esep {
  2403. ee.WriteMapElemValue()
  2404. }
  2405. ee.EncodeUint(uint64(v[uint8(k2)]))
  2406. }
  2407. } else {
  2408. for k2, v2 := range v {
  2409. if esep {
  2410. ee.WriteMapElemKey()
  2411. }
  2412. ee.EncodeUint(uint64(k2))
  2413. if esep {
  2414. ee.WriteMapElemValue()
  2415. }
  2416. ee.EncodeUint(uint64(v2))
  2417. }
  2418. }
  2419. ee.WriteMapEnd()
  2420. }
  2421. func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  2422. fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e)
  2423. }
  2424. func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) {
  2425. if v == nil {
  2426. e.e.EncodeNil()
  2427. return
  2428. }
  2429. ee, esep := e.e, e.hh.hasElemSeparators()
  2430. ee.WriteMapStart(len(v))
  2431. if e.h.Canonical {
  2432. v2 := make([]uint64, len(v))
  2433. var i uint
  2434. for k := range v {
  2435. v2[i] = uint64(k)
  2436. i++
  2437. }
  2438. sort.Sort(uint64Slice(v2))
  2439. for _, k2 := range v2 {
  2440. if esep {
  2441. ee.WriteMapElemKey()
  2442. }
  2443. ee.EncodeUint(uint64(uint8(k2)))
  2444. if esep {
  2445. ee.WriteMapElemValue()
  2446. }
  2447. ee.EncodeUint(v[uint8(k2)])
  2448. }
  2449. } else {
  2450. for k2, v2 := range v {
  2451. if esep {
  2452. ee.WriteMapElemKey()
  2453. }
  2454. ee.EncodeUint(uint64(k2))
  2455. if esep {
  2456. ee.WriteMapElemValue()
  2457. }
  2458. ee.EncodeUint(v2)
  2459. }
  2460. }
  2461. ee.WriteMapEnd()
  2462. }
  2463. func (e *Encoder) fastpathEncMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) {
  2464. fastpathTV.EncMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), e)
  2465. }
  2466. func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, e *Encoder) {
  2467. if v == nil {
  2468. e.e.EncodeNil()
  2469. return
  2470. }
  2471. ee, esep := e.e, e.hh.hasElemSeparators()
  2472. ee.WriteMapStart(len(v))
  2473. if e.h.Canonical {
  2474. v2 := make([]uint64, len(v))
  2475. var i uint
  2476. for k := range v {
  2477. v2[i] = uint64(k)
  2478. i++
  2479. }
  2480. sort.Sort(uint64Slice(v2))
  2481. for _, k2 := range v2 {
  2482. if esep {
  2483. ee.WriteMapElemKey()
  2484. }
  2485. ee.EncodeUint(uint64(uint8(k2)))
  2486. if esep {
  2487. ee.WriteMapElemValue()
  2488. }
  2489. e.encode(v[uint8(k2)])
  2490. }
  2491. } else {
  2492. for k2, v2 := range v {
  2493. if esep {
  2494. ee.WriteMapElemKey()
  2495. }
  2496. ee.EncodeUint(uint64(k2))
  2497. if esep {
  2498. ee.WriteMapElemValue()
  2499. }
  2500. e.encode(v2)
  2501. }
  2502. }
  2503. ee.WriteMapEnd()
  2504. }
  2505. func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  2506. fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e)
  2507. }
  2508. func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) {
  2509. if v == nil {
  2510. e.e.EncodeNil()
  2511. return
  2512. }
  2513. ee, esep := e.e, e.hh.hasElemSeparators()
  2514. ee.WriteMapStart(len(v))
  2515. if e.h.Canonical {
  2516. v2 := make([]uint64, len(v))
  2517. var i uint
  2518. for k := range v {
  2519. v2[i] = uint64(k)
  2520. i++
  2521. }
  2522. sort.Sort(uint64Slice(v2))
  2523. for _, k2 := range v2 {
  2524. if esep {
  2525. ee.WriteMapElemKey()
  2526. }
  2527. ee.EncodeUint(uint64(uint8(k2)))
  2528. if esep {
  2529. ee.WriteMapElemValue()
  2530. }
  2531. ee.EncodeInt(int64(v[uint8(k2)]))
  2532. }
  2533. } else {
  2534. for k2, v2 := range v {
  2535. if esep {
  2536. ee.WriteMapElemKey()
  2537. }
  2538. ee.EncodeUint(uint64(k2))
  2539. if esep {
  2540. ee.WriteMapElemValue()
  2541. }
  2542. ee.EncodeInt(int64(v2))
  2543. }
  2544. }
  2545. ee.WriteMapEnd()
  2546. }
  2547. func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  2548. fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e)
  2549. }
  2550. func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) {
  2551. if v == nil {
  2552. e.e.EncodeNil()
  2553. return
  2554. }
  2555. ee, esep := e.e, e.hh.hasElemSeparators()
  2556. ee.WriteMapStart(len(v))
  2557. if e.h.Canonical {
  2558. v2 := make([]uint64, len(v))
  2559. var i uint
  2560. for k := range v {
  2561. v2[i] = uint64(k)
  2562. i++
  2563. }
  2564. sort.Sort(uint64Slice(v2))
  2565. for _, k2 := range v2 {
  2566. if esep {
  2567. ee.WriteMapElemKey()
  2568. }
  2569. ee.EncodeUint(uint64(uint8(k2)))
  2570. if esep {
  2571. ee.WriteMapElemValue()
  2572. }
  2573. ee.EncodeInt(v[uint8(k2)])
  2574. }
  2575. } else {
  2576. for k2, v2 := range v {
  2577. if esep {
  2578. ee.WriteMapElemKey()
  2579. }
  2580. ee.EncodeUint(uint64(k2))
  2581. if esep {
  2582. ee.WriteMapElemValue()
  2583. }
  2584. ee.EncodeInt(v2)
  2585. }
  2586. }
  2587. ee.WriteMapEnd()
  2588. }
  2589. func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  2590. fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e)
  2591. }
  2592. func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) {
  2593. if v == nil {
  2594. e.e.EncodeNil()
  2595. return
  2596. }
  2597. ee, esep := e.e, e.hh.hasElemSeparators()
  2598. ee.WriteMapStart(len(v))
  2599. if e.h.Canonical {
  2600. v2 := make([]uint64, len(v))
  2601. var i uint
  2602. for k := range v {
  2603. v2[i] = uint64(k)
  2604. i++
  2605. }
  2606. sort.Sort(uint64Slice(v2))
  2607. for _, k2 := range v2 {
  2608. if esep {
  2609. ee.WriteMapElemKey()
  2610. }
  2611. ee.EncodeUint(uint64(uint8(k2)))
  2612. if esep {
  2613. ee.WriteMapElemValue()
  2614. }
  2615. ee.EncodeFloat32(v[uint8(k2)])
  2616. }
  2617. } else {
  2618. for k2, v2 := range v {
  2619. if esep {
  2620. ee.WriteMapElemKey()
  2621. }
  2622. ee.EncodeUint(uint64(k2))
  2623. if esep {
  2624. ee.WriteMapElemValue()
  2625. }
  2626. ee.EncodeFloat32(v2)
  2627. }
  2628. }
  2629. ee.WriteMapEnd()
  2630. }
  2631. func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  2632. fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e)
  2633. }
  2634. func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) {
  2635. if v == nil {
  2636. e.e.EncodeNil()
  2637. return
  2638. }
  2639. ee, esep := e.e, e.hh.hasElemSeparators()
  2640. ee.WriteMapStart(len(v))
  2641. if e.h.Canonical {
  2642. v2 := make([]uint64, len(v))
  2643. var i uint
  2644. for k := range v {
  2645. v2[i] = uint64(k)
  2646. i++
  2647. }
  2648. sort.Sort(uint64Slice(v2))
  2649. for _, k2 := range v2 {
  2650. if esep {
  2651. ee.WriteMapElemKey()
  2652. }
  2653. ee.EncodeUint(uint64(uint8(k2)))
  2654. if esep {
  2655. ee.WriteMapElemValue()
  2656. }
  2657. ee.EncodeFloat64(v[uint8(k2)])
  2658. }
  2659. } else {
  2660. for k2, v2 := range v {
  2661. if esep {
  2662. ee.WriteMapElemKey()
  2663. }
  2664. ee.EncodeUint(uint64(k2))
  2665. if esep {
  2666. ee.WriteMapElemValue()
  2667. }
  2668. ee.EncodeFloat64(v2)
  2669. }
  2670. }
  2671. ee.WriteMapEnd()
  2672. }
  2673. func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  2674. fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e)
  2675. }
  2676. func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) {
  2677. if v == nil {
  2678. e.e.EncodeNil()
  2679. return
  2680. }
  2681. ee, esep := e.e, e.hh.hasElemSeparators()
  2682. ee.WriteMapStart(len(v))
  2683. if e.h.Canonical {
  2684. v2 := make([]uint64, len(v))
  2685. var i uint
  2686. for k := range v {
  2687. v2[i] = uint64(k)
  2688. i++
  2689. }
  2690. sort.Sort(uint64Slice(v2))
  2691. for _, k2 := range v2 {
  2692. if esep {
  2693. ee.WriteMapElemKey()
  2694. }
  2695. ee.EncodeUint(uint64(uint8(k2)))
  2696. if esep {
  2697. ee.WriteMapElemValue()
  2698. }
  2699. ee.EncodeBool(v[uint8(k2)])
  2700. }
  2701. } else {
  2702. for k2, v2 := range v {
  2703. if esep {
  2704. ee.WriteMapElemKey()
  2705. }
  2706. ee.EncodeUint(uint64(k2))
  2707. if esep {
  2708. ee.WriteMapElemValue()
  2709. }
  2710. ee.EncodeBool(v2)
  2711. }
  2712. }
  2713. ee.WriteMapEnd()
  2714. }
  2715. func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  2716. fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e)
  2717. }
  2718. func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) {
  2719. if v == nil {
  2720. e.e.EncodeNil()
  2721. return
  2722. }
  2723. ee, esep := e.e, e.hh.hasElemSeparators()
  2724. ee.WriteMapStart(len(v))
  2725. if e.h.Canonical {
  2726. v2 := make([]uint64, len(v))
  2727. var i uint
  2728. for k := range v {
  2729. v2[i] = k
  2730. i++
  2731. }
  2732. sort.Sort(uint64Slice(v2))
  2733. for _, k2 := range v2 {
  2734. if esep {
  2735. ee.WriteMapElemKey()
  2736. }
  2737. ee.EncodeUint(k2)
  2738. if esep {
  2739. ee.WriteMapElemValue()
  2740. }
  2741. e.encode(v[k2])
  2742. }
  2743. } else {
  2744. for k2, v2 := range v {
  2745. if esep {
  2746. ee.WriteMapElemKey()
  2747. }
  2748. ee.EncodeUint(k2)
  2749. if esep {
  2750. ee.WriteMapElemValue()
  2751. }
  2752. e.encode(v2)
  2753. }
  2754. }
  2755. ee.WriteMapEnd()
  2756. }
  2757. func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  2758. fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e)
  2759. }
  2760. func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) {
  2761. if v == nil {
  2762. e.e.EncodeNil()
  2763. return
  2764. }
  2765. ee, esep := e.e, e.hh.hasElemSeparators()
  2766. ee.WriteMapStart(len(v))
  2767. if e.h.Canonical {
  2768. v2 := make([]uint64, len(v))
  2769. var i uint
  2770. for k := range v {
  2771. v2[i] = k
  2772. i++
  2773. }
  2774. sort.Sort(uint64Slice(v2))
  2775. for _, k2 := range v2 {
  2776. if esep {
  2777. ee.WriteMapElemKey()
  2778. }
  2779. ee.EncodeUint(k2)
  2780. if esep {
  2781. ee.WriteMapElemValue()
  2782. }
  2783. if e.h.StringToRaw {
  2784. ee.EncodeStringBytesRaw(bytesView(v[k2]))
  2785. } else {
  2786. ee.EncodeStringEnc(cUTF8, v[k2])
  2787. }
  2788. }
  2789. } else {
  2790. for k2, v2 := range v {
  2791. if esep {
  2792. ee.WriteMapElemKey()
  2793. }
  2794. ee.EncodeUint(k2)
  2795. if esep {
  2796. ee.WriteMapElemValue()
  2797. }
  2798. if e.h.StringToRaw {
  2799. ee.EncodeStringBytesRaw(bytesView(v2))
  2800. } else {
  2801. ee.EncodeStringEnc(cUTF8, v2)
  2802. }
  2803. }
  2804. }
  2805. ee.WriteMapEnd()
  2806. }
  2807. func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  2808. fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e)
  2809. }
  2810. func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) {
  2811. if v == nil {
  2812. e.e.EncodeNil()
  2813. return
  2814. }
  2815. ee, esep := e.e, e.hh.hasElemSeparators()
  2816. ee.WriteMapStart(len(v))
  2817. if e.h.Canonical {
  2818. v2 := make([]uint64, len(v))
  2819. var i uint
  2820. for k := range v {
  2821. v2[i] = k
  2822. i++
  2823. }
  2824. sort.Sort(uint64Slice(v2))
  2825. for _, k2 := range v2 {
  2826. if esep {
  2827. ee.WriteMapElemKey()
  2828. }
  2829. ee.EncodeUint(k2)
  2830. if esep {
  2831. ee.WriteMapElemValue()
  2832. }
  2833. ee.EncodeUint(uint64(v[k2]))
  2834. }
  2835. } else {
  2836. for k2, v2 := range v {
  2837. if esep {
  2838. ee.WriteMapElemKey()
  2839. }
  2840. ee.EncodeUint(k2)
  2841. if esep {
  2842. ee.WriteMapElemValue()
  2843. }
  2844. ee.EncodeUint(uint64(v2))
  2845. }
  2846. }
  2847. ee.WriteMapEnd()
  2848. }
  2849. func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  2850. fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e)
  2851. }
  2852. func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) {
  2853. if v == nil {
  2854. e.e.EncodeNil()
  2855. return
  2856. }
  2857. ee, esep := e.e, e.hh.hasElemSeparators()
  2858. ee.WriteMapStart(len(v))
  2859. if e.h.Canonical {
  2860. v2 := make([]uint64, len(v))
  2861. var i uint
  2862. for k := range v {
  2863. v2[i] = k
  2864. i++
  2865. }
  2866. sort.Sort(uint64Slice(v2))
  2867. for _, k2 := range v2 {
  2868. if esep {
  2869. ee.WriteMapElemKey()
  2870. }
  2871. ee.EncodeUint(k2)
  2872. if esep {
  2873. ee.WriteMapElemValue()
  2874. }
  2875. ee.EncodeUint(uint64(v[k2]))
  2876. }
  2877. } else {
  2878. for k2, v2 := range v {
  2879. if esep {
  2880. ee.WriteMapElemKey()
  2881. }
  2882. ee.EncodeUint(k2)
  2883. if esep {
  2884. ee.WriteMapElemValue()
  2885. }
  2886. ee.EncodeUint(uint64(v2))
  2887. }
  2888. }
  2889. ee.WriteMapEnd()
  2890. }
  2891. func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  2892. fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e)
  2893. }
  2894. func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) {
  2895. if v == nil {
  2896. e.e.EncodeNil()
  2897. return
  2898. }
  2899. ee, esep := e.e, e.hh.hasElemSeparators()
  2900. ee.WriteMapStart(len(v))
  2901. if e.h.Canonical {
  2902. v2 := make([]uint64, len(v))
  2903. var i uint
  2904. for k := range v {
  2905. v2[i] = k
  2906. i++
  2907. }
  2908. sort.Sort(uint64Slice(v2))
  2909. for _, k2 := range v2 {
  2910. if esep {
  2911. ee.WriteMapElemKey()
  2912. }
  2913. ee.EncodeUint(k2)
  2914. if esep {
  2915. ee.WriteMapElemValue()
  2916. }
  2917. ee.EncodeUint(v[k2])
  2918. }
  2919. } else {
  2920. for k2, v2 := range v {
  2921. if esep {
  2922. ee.WriteMapElemKey()
  2923. }
  2924. ee.EncodeUint(k2)
  2925. if esep {
  2926. ee.WriteMapElemValue()
  2927. }
  2928. ee.EncodeUint(v2)
  2929. }
  2930. }
  2931. ee.WriteMapEnd()
  2932. }
  2933. func (e *Encoder) fastpathEncMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) {
  2934. fastpathTV.EncMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), e)
  2935. }
  2936. func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, e *Encoder) {
  2937. if v == nil {
  2938. e.e.EncodeNil()
  2939. return
  2940. }
  2941. ee, esep := e.e, e.hh.hasElemSeparators()
  2942. ee.WriteMapStart(len(v))
  2943. if e.h.Canonical {
  2944. v2 := make([]uint64, len(v))
  2945. var i uint
  2946. for k := range v {
  2947. v2[i] = k
  2948. i++
  2949. }
  2950. sort.Sort(uint64Slice(v2))
  2951. for _, k2 := range v2 {
  2952. if esep {
  2953. ee.WriteMapElemKey()
  2954. }
  2955. ee.EncodeUint(k2)
  2956. if esep {
  2957. ee.WriteMapElemValue()
  2958. }
  2959. e.encode(v[k2])
  2960. }
  2961. } else {
  2962. for k2, v2 := range v {
  2963. if esep {
  2964. ee.WriteMapElemKey()
  2965. }
  2966. ee.EncodeUint(k2)
  2967. if esep {
  2968. ee.WriteMapElemValue()
  2969. }
  2970. e.encode(v2)
  2971. }
  2972. }
  2973. ee.WriteMapEnd()
  2974. }
  2975. func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  2976. fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e)
  2977. }
  2978. func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) {
  2979. if v == nil {
  2980. e.e.EncodeNil()
  2981. return
  2982. }
  2983. ee, esep := e.e, e.hh.hasElemSeparators()
  2984. ee.WriteMapStart(len(v))
  2985. if e.h.Canonical {
  2986. v2 := make([]uint64, len(v))
  2987. var i uint
  2988. for k := range v {
  2989. v2[i] = k
  2990. i++
  2991. }
  2992. sort.Sort(uint64Slice(v2))
  2993. for _, k2 := range v2 {
  2994. if esep {
  2995. ee.WriteMapElemKey()
  2996. }
  2997. ee.EncodeUint(k2)
  2998. if esep {
  2999. ee.WriteMapElemValue()
  3000. }
  3001. ee.EncodeInt(int64(v[k2]))
  3002. }
  3003. } else {
  3004. for k2, v2 := range v {
  3005. if esep {
  3006. ee.WriteMapElemKey()
  3007. }
  3008. ee.EncodeUint(k2)
  3009. if esep {
  3010. ee.WriteMapElemValue()
  3011. }
  3012. ee.EncodeInt(int64(v2))
  3013. }
  3014. }
  3015. ee.WriteMapEnd()
  3016. }
  3017. func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  3018. fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e)
  3019. }
  3020. func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) {
  3021. if v == nil {
  3022. e.e.EncodeNil()
  3023. return
  3024. }
  3025. ee, esep := e.e, e.hh.hasElemSeparators()
  3026. ee.WriteMapStart(len(v))
  3027. if e.h.Canonical {
  3028. v2 := make([]uint64, len(v))
  3029. var i uint
  3030. for k := range v {
  3031. v2[i] = k
  3032. i++
  3033. }
  3034. sort.Sort(uint64Slice(v2))
  3035. for _, k2 := range v2 {
  3036. if esep {
  3037. ee.WriteMapElemKey()
  3038. }
  3039. ee.EncodeUint(k2)
  3040. if esep {
  3041. ee.WriteMapElemValue()
  3042. }
  3043. ee.EncodeInt(v[k2])
  3044. }
  3045. } else {
  3046. for k2, v2 := range v {
  3047. if esep {
  3048. ee.WriteMapElemKey()
  3049. }
  3050. ee.EncodeUint(k2)
  3051. if esep {
  3052. ee.WriteMapElemValue()
  3053. }
  3054. ee.EncodeInt(v2)
  3055. }
  3056. }
  3057. ee.WriteMapEnd()
  3058. }
  3059. func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  3060. fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e)
  3061. }
  3062. func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) {
  3063. if v == nil {
  3064. e.e.EncodeNil()
  3065. return
  3066. }
  3067. ee, esep := e.e, e.hh.hasElemSeparators()
  3068. ee.WriteMapStart(len(v))
  3069. if e.h.Canonical {
  3070. v2 := make([]uint64, len(v))
  3071. var i uint
  3072. for k := range v {
  3073. v2[i] = k
  3074. i++
  3075. }
  3076. sort.Sort(uint64Slice(v2))
  3077. for _, k2 := range v2 {
  3078. if esep {
  3079. ee.WriteMapElemKey()
  3080. }
  3081. ee.EncodeUint(k2)
  3082. if esep {
  3083. ee.WriteMapElemValue()
  3084. }
  3085. ee.EncodeFloat32(v[k2])
  3086. }
  3087. } else {
  3088. for k2, v2 := range v {
  3089. if esep {
  3090. ee.WriteMapElemKey()
  3091. }
  3092. ee.EncodeUint(k2)
  3093. if esep {
  3094. ee.WriteMapElemValue()
  3095. }
  3096. ee.EncodeFloat32(v2)
  3097. }
  3098. }
  3099. ee.WriteMapEnd()
  3100. }
  3101. func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  3102. fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e)
  3103. }
  3104. func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) {
  3105. if v == nil {
  3106. e.e.EncodeNil()
  3107. return
  3108. }
  3109. ee, esep := e.e, e.hh.hasElemSeparators()
  3110. ee.WriteMapStart(len(v))
  3111. if e.h.Canonical {
  3112. v2 := make([]uint64, len(v))
  3113. var i uint
  3114. for k := range v {
  3115. v2[i] = k
  3116. i++
  3117. }
  3118. sort.Sort(uint64Slice(v2))
  3119. for _, k2 := range v2 {
  3120. if esep {
  3121. ee.WriteMapElemKey()
  3122. }
  3123. ee.EncodeUint(k2)
  3124. if esep {
  3125. ee.WriteMapElemValue()
  3126. }
  3127. ee.EncodeFloat64(v[k2])
  3128. }
  3129. } else {
  3130. for k2, v2 := range v {
  3131. if esep {
  3132. ee.WriteMapElemKey()
  3133. }
  3134. ee.EncodeUint(k2)
  3135. if esep {
  3136. ee.WriteMapElemValue()
  3137. }
  3138. ee.EncodeFloat64(v2)
  3139. }
  3140. }
  3141. ee.WriteMapEnd()
  3142. }
  3143. func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  3144. fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e)
  3145. }
  3146. func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) {
  3147. if v == nil {
  3148. e.e.EncodeNil()
  3149. return
  3150. }
  3151. ee, esep := e.e, e.hh.hasElemSeparators()
  3152. ee.WriteMapStart(len(v))
  3153. if e.h.Canonical {
  3154. v2 := make([]uint64, len(v))
  3155. var i uint
  3156. for k := range v {
  3157. v2[i] = k
  3158. i++
  3159. }
  3160. sort.Sort(uint64Slice(v2))
  3161. for _, k2 := range v2 {
  3162. if esep {
  3163. ee.WriteMapElemKey()
  3164. }
  3165. ee.EncodeUint(k2)
  3166. if esep {
  3167. ee.WriteMapElemValue()
  3168. }
  3169. ee.EncodeBool(v[k2])
  3170. }
  3171. } else {
  3172. for k2, v2 := range v {
  3173. if esep {
  3174. ee.WriteMapElemKey()
  3175. }
  3176. ee.EncodeUint(k2)
  3177. if esep {
  3178. ee.WriteMapElemValue()
  3179. }
  3180. ee.EncodeBool(v2)
  3181. }
  3182. }
  3183. ee.WriteMapEnd()
  3184. }
  3185. func (e *Encoder) fastpathEncMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) {
  3186. fastpathTV.EncMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), e)
  3187. }
  3188. func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, e *Encoder) {
  3189. if v == nil {
  3190. e.e.EncodeNil()
  3191. return
  3192. }
  3193. ee, esep := e.e, e.hh.hasElemSeparators()
  3194. ee.WriteMapStart(len(v))
  3195. if e.h.Canonical {
  3196. v2 := make([]uint64, len(v))
  3197. var i uint
  3198. for k := range v {
  3199. v2[i] = uint64(k)
  3200. i++
  3201. }
  3202. sort.Sort(uint64Slice(v2))
  3203. for _, k2 := range v2 {
  3204. if esep {
  3205. ee.WriteMapElemKey()
  3206. }
  3207. e.encode(uintptr(k2))
  3208. if esep {
  3209. ee.WriteMapElemValue()
  3210. }
  3211. e.encode(v[uintptr(k2)])
  3212. }
  3213. } else {
  3214. for k2, v2 := range v {
  3215. if esep {
  3216. ee.WriteMapElemKey()
  3217. }
  3218. e.encode(k2)
  3219. if esep {
  3220. ee.WriteMapElemValue()
  3221. }
  3222. e.encode(v2)
  3223. }
  3224. }
  3225. ee.WriteMapEnd()
  3226. }
  3227. func (e *Encoder) fastpathEncMapUintptrStringR(f *codecFnInfo, rv reflect.Value) {
  3228. fastpathTV.EncMapUintptrStringV(rv2i(rv).(map[uintptr]string), e)
  3229. }
  3230. func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, e *Encoder) {
  3231. if v == nil {
  3232. e.e.EncodeNil()
  3233. return
  3234. }
  3235. ee, esep := e.e, e.hh.hasElemSeparators()
  3236. ee.WriteMapStart(len(v))
  3237. if e.h.Canonical {
  3238. v2 := make([]uint64, len(v))
  3239. var i uint
  3240. for k := range v {
  3241. v2[i] = uint64(k)
  3242. i++
  3243. }
  3244. sort.Sort(uint64Slice(v2))
  3245. for _, k2 := range v2 {
  3246. if esep {
  3247. ee.WriteMapElemKey()
  3248. }
  3249. e.encode(uintptr(k2))
  3250. if esep {
  3251. ee.WriteMapElemValue()
  3252. }
  3253. if e.h.StringToRaw {
  3254. ee.EncodeStringBytesRaw(bytesView(v[uintptr(k2)]))
  3255. } else {
  3256. ee.EncodeStringEnc(cUTF8, v[uintptr(k2)])
  3257. }
  3258. }
  3259. } else {
  3260. for k2, v2 := range v {
  3261. if esep {
  3262. ee.WriteMapElemKey()
  3263. }
  3264. e.encode(k2)
  3265. if esep {
  3266. ee.WriteMapElemValue()
  3267. }
  3268. if e.h.StringToRaw {
  3269. ee.EncodeStringBytesRaw(bytesView(v2))
  3270. } else {
  3271. ee.EncodeStringEnc(cUTF8, v2)
  3272. }
  3273. }
  3274. }
  3275. ee.WriteMapEnd()
  3276. }
  3277. func (e *Encoder) fastpathEncMapUintptrUintR(f *codecFnInfo, rv reflect.Value) {
  3278. fastpathTV.EncMapUintptrUintV(rv2i(rv).(map[uintptr]uint), e)
  3279. }
  3280. func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, e *Encoder) {
  3281. if v == nil {
  3282. e.e.EncodeNil()
  3283. return
  3284. }
  3285. ee, esep := e.e, e.hh.hasElemSeparators()
  3286. ee.WriteMapStart(len(v))
  3287. if e.h.Canonical {
  3288. v2 := make([]uint64, len(v))
  3289. var i uint
  3290. for k := range v {
  3291. v2[i] = uint64(k)
  3292. i++
  3293. }
  3294. sort.Sort(uint64Slice(v2))
  3295. for _, k2 := range v2 {
  3296. if esep {
  3297. ee.WriteMapElemKey()
  3298. }
  3299. e.encode(uintptr(k2))
  3300. if esep {
  3301. ee.WriteMapElemValue()
  3302. }
  3303. ee.EncodeUint(uint64(v[uintptr(k2)]))
  3304. }
  3305. } else {
  3306. for k2, v2 := range v {
  3307. if esep {
  3308. ee.WriteMapElemKey()
  3309. }
  3310. e.encode(k2)
  3311. if esep {
  3312. ee.WriteMapElemValue()
  3313. }
  3314. ee.EncodeUint(uint64(v2))
  3315. }
  3316. }
  3317. ee.WriteMapEnd()
  3318. }
  3319. func (e *Encoder) fastpathEncMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) {
  3320. fastpathTV.EncMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), e)
  3321. }
  3322. func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, e *Encoder) {
  3323. if v == nil {
  3324. e.e.EncodeNil()
  3325. return
  3326. }
  3327. ee, esep := e.e, e.hh.hasElemSeparators()
  3328. ee.WriteMapStart(len(v))
  3329. if e.h.Canonical {
  3330. v2 := make([]uint64, len(v))
  3331. var i uint
  3332. for k := range v {
  3333. v2[i] = uint64(k)
  3334. i++
  3335. }
  3336. sort.Sort(uint64Slice(v2))
  3337. for _, k2 := range v2 {
  3338. if esep {
  3339. ee.WriteMapElemKey()
  3340. }
  3341. e.encode(uintptr(k2))
  3342. if esep {
  3343. ee.WriteMapElemValue()
  3344. }
  3345. ee.EncodeUint(uint64(v[uintptr(k2)]))
  3346. }
  3347. } else {
  3348. for k2, v2 := range v {
  3349. if esep {
  3350. ee.WriteMapElemKey()
  3351. }
  3352. e.encode(k2)
  3353. if esep {
  3354. ee.WriteMapElemValue()
  3355. }
  3356. ee.EncodeUint(uint64(v2))
  3357. }
  3358. }
  3359. ee.WriteMapEnd()
  3360. }
  3361. func (e *Encoder) fastpathEncMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) {
  3362. fastpathTV.EncMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), e)
  3363. }
  3364. func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, e *Encoder) {
  3365. if v == nil {
  3366. e.e.EncodeNil()
  3367. return
  3368. }
  3369. ee, esep := e.e, e.hh.hasElemSeparators()
  3370. ee.WriteMapStart(len(v))
  3371. if e.h.Canonical {
  3372. v2 := make([]uint64, len(v))
  3373. var i uint
  3374. for k := range v {
  3375. v2[i] = uint64(k)
  3376. i++
  3377. }
  3378. sort.Sort(uint64Slice(v2))
  3379. for _, k2 := range v2 {
  3380. if esep {
  3381. ee.WriteMapElemKey()
  3382. }
  3383. e.encode(uintptr(k2))
  3384. if esep {
  3385. ee.WriteMapElemValue()
  3386. }
  3387. ee.EncodeUint(v[uintptr(k2)])
  3388. }
  3389. } else {
  3390. for k2, v2 := range v {
  3391. if esep {
  3392. ee.WriteMapElemKey()
  3393. }
  3394. e.encode(k2)
  3395. if esep {
  3396. ee.WriteMapElemValue()
  3397. }
  3398. ee.EncodeUint(v2)
  3399. }
  3400. }
  3401. ee.WriteMapEnd()
  3402. }
  3403. func (e *Encoder) fastpathEncMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) {
  3404. fastpathTV.EncMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), e)
  3405. }
  3406. func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, e *Encoder) {
  3407. if v == nil {
  3408. e.e.EncodeNil()
  3409. return
  3410. }
  3411. ee, esep := e.e, e.hh.hasElemSeparators()
  3412. ee.WriteMapStart(len(v))
  3413. if e.h.Canonical {
  3414. v2 := make([]uint64, len(v))
  3415. var i uint
  3416. for k := range v {
  3417. v2[i] = uint64(k)
  3418. i++
  3419. }
  3420. sort.Sort(uint64Slice(v2))
  3421. for _, k2 := range v2 {
  3422. if esep {
  3423. ee.WriteMapElemKey()
  3424. }
  3425. e.encode(uintptr(k2))
  3426. if esep {
  3427. ee.WriteMapElemValue()
  3428. }
  3429. e.encode(v[uintptr(k2)])
  3430. }
  3431. } else {
  3432. for k2, v2 := range v {
  3433. if esep {
  3434. ee.WriteMapElemKey()
  3435. }
  3436. e.encode(k2)
  3437. if esep {
  3438. ee.WriteMapElemValue()
  3439. }
  3440. e.encode(v2)
  3441. }
  3442. }
  3443. ee.WriteMapEnd()
  3444. }
  3445. func (e *Encoder) fastpathEncMapUintptrIntR(f *codecFnInfo, rv reflect.Value) {
  3446. fastpathTV.EncMapUintptrIntV(rv2i(rv).(map[uintptr]int), e)
  3447. }
  3448. func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, e *Encoder) {
  3449. if v == nil {
  3450. e.e.EncodeNil()
  3451. return
  3452. }
  3453. ee, esep := e.e, e.hh.hasElemSeparators()
  3454. ee.WriteMapStart(len(v))
  3455. if e.h.Canonical {
  3456. v2 := make([]uint64, len(v))
  3457. var i uint
  3458. for k := range v {
  3459. v2[i] = uint64(k)
  3460. i++
  3461. }
  3462. sort.Sort(uint64Slice(v2))
  3463. for _, k2 := range v2 {
  3464. if esep {
  3465. ee.WriteMapElemKey()
  3466. }
  3467. e.encode(uintptr(k2))
  3468. if esep {
  3469. ee.WriteMapElemValue()
  3470. }
  3471. ee.EncodeInt(int64(v[uintptr(k2)]))
  3472. }
  3473. } else {
  3474. for k2, v2 := range v {
  3475. if esep {
  3476. ee.WriteMapElemKey()
  3477. }
  3478. e.encode(k2)
  3479. if esep {
  3480. ee.WriteMapElemValue()
  3481. }
  3482. ee.EncodeInt(int64(v2))
  3483. }
  3484. }
  3485. ee.WriteMapEnd()
  3486. }
  3487. func (e *Encoder) fastpathEncMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) {
  3488. fastpathTV.EncMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), e)
  3489. }
  3490. func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, e *Encoder) {
  3491. if v == nil {
  3492. e.e.EncodeNil()
  3493. return
  3494. }
  3495. ee, esep := e.e, e.hh.hasElemSeparators()
  3496. ee.WriteMapStart(len(v))
  3497. if e.h.Canonical {
  3498. v2 := make([]uint64, len(v))
  3499. var i uint
  3500. for k := range v {
  3501. v2[i] = uint64(k)
  3502. i++
  3503. }
  3504. sort.Sort(uint64Slice(v2))
  3505. for _, k2 := range v2 {
  3506. if esep {
  3507. ee.WriteMapElemKey()
  3508. }
  3509. e.encode(uintptr(k2))
  3510. if esep {
  3511. ee.WriteMapElemValue()
  3512. }
  3513. ee.EncodeInt(v[uintptr(k2)])
  3514. }
  3515. } else {
  3516. for k2, v2 := range v {
  3517. if esep {
  3518. ee.WriteMapElemKey()
  3519. }
  3520. e.encode(k2)
  3521. if esep {
  3522. ee.WriteMapElemValue()
  3523. }
  3524. ee.EncodeInt(v2)
  3525. }
  3526. }
  3527. ee.WriteMapEnd()
  3528. }
  3529. func (e *Encoder) fastpathEncMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) {
  3530. fastpathTV.EncMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), e)
  3531. }
  3532. func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, e *Encoder) {
  3533. if v == nil {
  3534. e.e.EncodeNil()
  3535. return
  3536. }
  3537. ee, esep := e.e, e.hh.hasElemSeparators()
  3538. ee.WriteMapStart(len(v))
  3539. if e.h.Canonical {
  3540. v2 := make([]uint64, len(v))
  3541. var i uint
  3542. for k := range v {
  3543. v2[i] = uint64(k)
  3544. i++
  3545. }
  3546. sort.Sort(uint64Slice(v2))
  3547. for _, k2 := range v2 {
  3548. if esep {
  3549. ee.WriteMapElemKey()
  3550. }
  3551. e.encode(uintptr(k2))
  3552. if esep {
  3553. ee.WriteMapElemValue()
  3554. }
  3555. ee.EncodeFloat32(v[uintptr(k2)])
  3556. }
  3557. } else {
  3558. for k2, v2 := range v {
  3559. if esep {
  3560. ee.WriteMapElemKey()
  3561. }
  3562. e.encode(k2)
  3563. if esep {
  3564. ee.WriteMapElemValue()
  3565. }
  3566. ee.EncodeFloat32(v2)
  3567. }
  3568. }
  3569. ee.WriteMapEnd()
  3570. }
  3571. func (e *Encoder) fastpathEncMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) {
  3572. fastpathTV.EncMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), e)
  3573. }
  3574. func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, e *Encoder) {
  3575. if v == nil {
  3576. e.e.EncodeNil()
  3577. return
  3578. }
  3579. ee, esep := e.e, e.hh.hasElemSeparators()
  3580. ee.WriteMapStart(len(v))
  3581. if e.h.Canonical {
  3582. v2 := make([]uint64, len(v))
  3583. var i uint
  3584. for k := range v {
  3585. v2[i] = uint64(k)
  3586. i++
  3587. }
  3588. sort.Sort(uint64Slice(v2))
  3589. for _, k2 := range v2 {
  3590. if esep {
  3591. ee.WriteMapElemKey()
  3592. }
  3593. e.encode(uintptr(k2))
  3594. if esep {
  3595. ee.WriteMapElemValue()
  3596. }
  3597. ee.EncodeFloat64(v[uintptr(k2)])
  3598. }
  3599. } else {
  3600. for k2, v2 := range v {
  3601. if esep {
  3602. ee.WriteMapElemKey()
  3603. }
  3604. e.encode(k2)
  3605. if esep {
  3606. ee.WriteMapElemValue()
  3607. }
  3608. ee.EncodeFloat64(v2)
  3609. }
  3610. }
  3611. ee.WriteMapEnd()
  3612. }
  3613. func (e *Encoder) fastpathEncMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) {
  3614. fastpathTV.EncMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), e)
  3615. }
  3616. func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, e *Encoder) {
  3617. if v == nil {
  3618. e.e.EncodeNil()
  3619. return
  3620. }
  3621. ee, esep := e.e, e.hh.hasElemSeparators()
  3622. ee.WriteMapStart(len(v))
  3623. if e.h.Canonical {
  3624. v2 := make([]uint64, len(v))
  3625. var i uint
  3626. for k := range v {
  3627. v2[i] = uint64(k)
  3628. i++
  3629. }
  3630. sort.Sort(uint64Slice(v2))
  3631. for _, k2 := range v2 {
  3632. if esep {
  3633. ee.WriteMapElemKey()
  3634. }
  3635. e.encode(uintptr(k2))
  3636. if esep {
  3637. ee.WriteMapElemValue()
  3638. }
  3639. ee.EncodeBool(v[uintptr(k2)])
  3640. }
  3641. } else {
  3642. for k2, v2 := range v {
  3643. if esep {
  3644. ee.WriteMapElemKey()
  3645. }
  3646. e.encode(k2)
  3647. if esep {
  3648. ee.WriteMapElemValue()
  3649. }
  3650. ee.EncodeBool(v2)
  3651. }
  3652. }
  3653. ee.WriteMapEnd()
  3654. }
  3655. func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  3656. fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e)
  3657. }
  3658. func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) {
  3659. if v == nil {
  3660. e.e.EncodeNil()
  3661. return
  3662. }
  3663. ee, esep := e.e, e.hh.hasElemSeparators()
  3664. ee.WriteMapStart(len(v))
  3665. if e.h.Canonical {
  3666. v2 := make([]int64, len(v))
  3667. var i uint
  3668. for k := range v {
  3669. v2[i] = int64(k)
  3670. i++
  3671. }
  3672. sort.Sort(int64Slice(v2))
  3673. for _, k2 := range v2 {
  3674. if esep {
  3675. ee.WriteMapElemKey()
  3676. }
  3677. ee.EncodeInt(int64(int(k2)))
  3678. if esep {
  3679. ee.WriteMapElemValue()
  3680. }
  3681. e.encode(v[int(k2)])
  3682. }
  3683. } else {
  3684. for k2, v2 := range v {
  3685. if esep {
  3686. ee.WriteMapElemKey()
  3687. }
  3688. ee.EncodeInt(int64(k2))
  3689. if esep {
  3690. ee.WriteMapElemValue()
  3691. }
  3692. e.encode(v2)
  3693. }
  3694. }
  3695. ee.WriteMapEnd()
  3696. }
  3697. func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  3698. fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e)
  3699. }
  3700. func (_ fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) {
  3701. if v == nil {
  3702. e.e.EncodeNil()
  3703. return
  3704. }
  3705. ee, esep := e.e, e.hh.hasElemSeparators()
  3706. ee.WriteMapStart(len(v))
  3707. if e.h.Canonical {
  3708. v2 := make([]int64, len(v))
  3709. var i uint
  3710. for k := range v {
  3711. v2[i] = int64(k)
  3712. i++
  3713. }
  3714. sort.Sort(int64Slice(v2))
  3715. for _, k2 := range v2 {
  3716. if esep {
  3717. ee.WriteMapElemKey()
  3718. }
  3719. ee.EncodeInt(int64(int(k2)))
  3720. if esep {
  3721. ee.WriteMapElemValue()
  3722. }
  3723. if e.h.StringToRaw {
  3724. ee.EncodeStringBytesRaw(bytesView(v[int(k2)]))
  3725. } else {
  3726. ee.EncodeStringEnc(cUTF8, v[int(k2)])
  3727. }
  3728. }
  3729. } else {
  3730. for k2, v2 := range v {
  3731. if esep {
  3732. ee.WriteMapElemKey()
  3733. }
  3734. ee.EncodeInt(int64(k2))
  3735. if esep {
  3736. ee.WriteMapElemValue()
  3737. }
  3738. if e.h.StringToRaw {
  3739. ee.EncodeStringBytesRaw(bytesView(v2))
  3740. } else {
  3741. ee.EncodeStringEnc(cUTF8, v2)
  3742. }
  3743. }
  3744. }
  3745. ee.WriteMapEnd()
  3746. }
  3747. func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  3748. fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e)
  3749. }
  3750. func (_ fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) {
  3751. if v == nil {
  3752. e.e.EncodeNil()
  3753. return
  3754. }
  3755. ee, esep := e.e, e.hh.hasElemSeparators()
  3756. ee.WriteMapStart(len(v))
  3757. if e.h.Canonical {
  3758. v2 := make([]int64, len(v))
  3759. var i uint
  3760. for k := range v {
  3761. v2[i] = int64(k)
  3762. i++
  3763. }
  3764. sort.Sort(int64Slice(v2))
  3765. for _, k2 := range v2 {
  3766. if esep {
  3767. ee.WriteMapElemKey()
  3768. }
  3769. ee.EncodeInt(int64(int(k2)))
  3770. if esep {
  3771. ee.WriteMapElemValue()
  3772. }
  3773. ee.EncodeUint(uint64(v[int(k2)]))
  3774. }
  3775. } else {
  3776. for k2, v2 := range v {
  3777. if esep {
  3778. ee.WriteMapElemKey()
  3779. }
  3780. ee.EncodeInt(int64(k2))
  3781. if esep {
  3782. ee.WriteMapElemValue()
  3783. }
  3784. ee.EncodeUint(uint64(v2))
  3785. }
  3786. }
  3787. ee.WriteMapEnd()
  3788. }
  3789. func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  3790. fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e)
  3791. }
  3792. func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) {
  3793. if v == nil {
  3794. e.e.EncodeNil()
  3795. return
  3796. }
  3797. ee, esep := e.e, e.hh.hasElemSeparators()
  3798. ee.WriteMapStart(len(v))
  3799. if e.h.Canonical {
  3800. v2 := make([]int64, len(v))
  3801. var i uint
  3802. for k := range v {
  3803. v2[i] = int64(k)
  3804. i++
  3805. }
  3806. sort.Sort(int64Slice(v2))
  3807. for _, k2 := range v2 {
  3808. if esep {
  3809. ee.WriteMapElemKey()
  3810. }
  3811. ee.EncodeInt(int64(int(k2)))
  3812. if esep {
  3813. ee.WriteMapElemValue()
  3814. }
  3815. ee.EncodeUint(uint64(v[int(k2)]))
  3816. }
  3817. } else {
  3818. for k2, v2 := range v {
  3819. if esep {
  3820. ee.WriteMapElemKey()
  3821. }
  3822. ee.EncodeInt(int64(k2))
  3823. if esep {
  3824. ee.WriteMapElemValue()
  3825. }
  3826. ee.EncodeUint(uint64(v2))
  3827. }
  3828. }
  3829. ee.WriteMapEnd()
  3830. }
  3831. func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  3832. fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e)
  3833. }
  3834. func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) {
  3835. if v == nil {
  3836. e.e.EncodeNil()
  3837. return
  3838. }
  3839. ee, esep := e.e, e.hh.hasElemSeparators()
  3840. ee.WriteMapStart(len(v))
  3841. if e.h.Canonical {
  3842. v2 := make([]int64, len(v))
  3843. var i uint
  3844. for k := range v {
  3845. v2[i] = int64(k)
  3846. i++
  3847. }
  3848. sort.Sort(int64Slice(v2))
  3849. for _, k2 := range v2 {
  3850. if esep {
  3851. ee.WriteMapElemKey()
  3852. }
  3853. ee.EncodeInt(int64(int(k2)))
  3854. if esep {
  3855. ee.WriteMapElemValue()
  3856. }
  3857. ee.EncodeUint(v[int(k2)])
  3858. }
  3859. } else {
  3860. for k2, v2 := range v {
  3861. if esep {
  3862. ee.WriteMapElemKey()
  3863. }
  3864. ee.EncodeInt(int64(k2))
  3865. if esep {
  3866. ee.WriteMapElemValue()
  3867. }
  3868. ee.EncodeUint(v2)
  3869. }
  3870. }
  3871. ee.WriteMapEnd()
  3872. }
  3873. func (e *Encoder) fastpathEncMapIntUintptrR(f *codecFnInfo, rv reflect.Value) {
  3874. fastpathTV.EncMapIntUintptrV(rv2i(rv).(map[int]uintptr), e)
  3875. }
  3876. func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, e *Encoder) {
  3877. if v == nil {
  3878. e.e.EncodeNil()
  3879. return
  3880. }
  3881. ee, esep := e.e, e.hh.hasElemSeparators()
  3882. ee.WriteMapStart(len(v))
  3883. if e.h.Canonical {
  3884. v2 := make([]int64, len(v))
  3885. var i uint
  3886. for k := range v {
  3887. v2[i] = int64(k)
  3888. i++
  3889. }
  3890. sort.Sort(int64Slice(v2))
  3891. for _, k2 := range v2 {
  3892. if esep {
  3893. ee.WriteMapElemKey()
  3894. }
  3895. ee.EncodeInt(int64(int(k2)))
  3896. if esep {
  3897. ee.WriteMapElemValue()
  3898. }
  3899. e.encode(v[int(k2)])
  3900. }
  3901. } else {
  3902. for k2, v2 := range v {
  3903. if esep {
  3904. ee.WriteMapElemKey()
  3905. }
  3906. ee.EncodeInt(int64(k2))
  3907. if esep {
  3908. ee.WriteMapElemValue()
  3909. }
  3910. e.encode(v2)
  3911. }
  3912. }
  3913. ee.WriteMapEnd()
  3914. }
  3915. func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  3916. fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e)
  3917. }
  3918. func (_ fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) {
  3919. if v == nil {
  3920. e.e.EncodeNil()
  3921. return
  3922. }
  3923. ee, esep := e.e, e.hh.hasElemSeparators()
  3924. ee.WriteMapStart(len(v))
  3925. if e.h.Canonical {
  3926. v2 := make([]int64, len(v))
  3927. var i uint
  3928. for k := range v {
  3929. v2[i] = int64(k)
  3930. i++
  3931. }
  3932. sort.Sort(int64Slice(v2))
  3933. for _, k2 := range v2 {
  3934. if esep {
  3935. ee.WriteMapElemKey()
  3936. }
  3937. ee.EncodeInt(int64(int(k2)))
  3938. if esep {
  3939. ee.WriteMapElemValue()
  3940. }
  3941. ee.EncodeInt(int64(v[int(k2)]))
  3942. }
  3943. } else {
  3944. for k2, v2 := range v {
  3945. if esep {
  3946. ee.WriteMapElemKey()
  3947. }
  3948. ee.EncodeInt(int64(k2))
  3949. if esep {
  3950. ee.WriteMapElemValue()
  3951. }
  3952. ee.EncodeInt(int64(v2))
  3953. }
  3954. }
  3955. ee.WriteMapEnd()
  3956. }
  3957. func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  3958. fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e)
  3959. }
  3960. func (_ fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) {
  3961. if v == nil {
  3962. e.e.EncodeNil()
  3963. return
  3964. }
  3965. ee, esep := e.e, e.hh.hasElemSeparators()
  3966. ee.WriteMapStart(len(v))
  3967. if e.h.Canonical {
  3968. v2 := make([]int64, len(v))
  3969. var i uint
  3970. for k := range v {
  3971. v2[i] = int64(k)
  3972. i++
  3973. }
  3974. sort.Sort(int64Slice(v2))
  3975. for _, k2 := range v2 {
  3976. if esep {
  3977. ee.WriteMapElemKey()
  3978. }
  3979. ee.EncodeInt(int64(int(k2)))
  3980. if esep {
  3981. ee.WriteMapElemValue()
  3982. }
  3983. ee.EncodeInt(v[int(k2)])
  3984. }
  3985. } else {
  3986. for k2, v2 := range v {
  3987. if esep {
  3988. ee.WriteMapElemKey()
  3989. }
  3990. ee.EncodeInt(int64(k2))
  3991. if esep {
  3992. ee.WriteMapElemValue()
  3993. }
  3994. ee.EncodeInt(v2)
  3995. }
  3996. }
  3997. ee.WriteMapEnd()
  3998. }
  3999. func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  4000. fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e)
  4001. }
  4002. func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) {
  4003. if v == nil {
  4004. e.e.EncodeNil()
  4005. return
  4006. }
  4007. ee, esep := e.e, e.hh.hasElemSeparators()
  4008. ee.WriteMapStart(len(v))
  4009. if e.h.Canonical {
  4010. v2 := make([]int64, len(v))
  4011. var i uint
  4012. for k := range v {
  4013. v2[i] = int64(k)
  4014. i++
  4015. }
  4016. sort.Sort(int64Slice(v2))
  4017. for _, k2 := range v2 {
  4018. if esep {
  4019. ee.WriteMapElemKey()
  4020. }
  4021. ee.EncodeInt(int64(int(k2)))
  4022. if esep {
  4023. ee.WriteMapElemValue()
  4024. }
  4025. ee.EncodeFloat32(v[int(k2)])
  4026. }
  4027. } else {
  4028. for k2, v2 := range v {
  4029. if esep {
  4030. ee.WriteMapElemKey()
  4031. }
  4032. ee.EncodeInt(int64(k2))
  4033. if esep {
  4034. ee.WriteMapElemValue()
  4035. }
  4036. ee.EncodeFloat32(v2)
  4037. }
  4038. }
  4039. ee.WriteMapEnd()
  4040. }
  4041. func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  4042. fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e)
  4043. }
  4044. func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) {
  4045. if v == nil {
  4046. e.e.EncodeNil()
  4047. return
  4048. }
  4049. ee, esep := e.e, e.hh.hasElemSeparators()
  4050. ee.WriteMapStart(len(v))
  4051. if e.h.Canonical {
  4052. v2 := make([]int64, len(v))
  4053. var i uint
  4054. for k := range v {
  4055. v2[i] = int64(k)
  4056. i++
  4057. }
  4058. sort.Sort(int64Slice(v2))
  4059. for _, k2 := range v2 {
  4060. if esep {
  4061. ee.WriteMapElemKey()
  4062. }
  4063. ee.EncodeInt(int64(int(k2)))
  4064. if esep {
  4065. ee.WriteMapElemValue()
  4066. }
  4067. ee.EncodeFloat64(v[int(k2)])
  4068. }
  4069. } else {
  4070. for k2, v2 := range v {
  4071. if esep {
  4072. ee.WriteMapElemKey()
  4073. }
  4074. ee.EncodeInt(int64(k2))
  4075. if esep {
  4076. ee.WriteMapElemValue()
  4077. }
  4078. ee.EncodeFloat64(v2)
  4079. }
  4080. }
  4081. ee.WriteMapEnd()
  4082. }
  4083. func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  4084. fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e)
  4085. }
  4086. func (_ fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) {
  4087. if v == nil {
  4088. e.e.EncodeNil()
  4089. return
  4090. }
  4091. ee, esep := e.e, e.hh.hasElemSeparators()
  4092. ee.WriteMapStart(len(v))
  4093. if e.h.Canonical {
  4094. v2 := make([]int64, len(v))
  4095. var i uint
  4096. for k := range v {
  4097. v2[i] = int64(k)
  4098. i++
  4099. }
  4100. sort.Sort(int64Slice(v2))
  4101. for _, k2 := range v2 {
  4102. if esep {
  4103. ee.WriteMapElemKey()
  4104. }
  4105. ee.EncodeInt(int64(int(k2)))
  4106. if esep {
  4107. ee.WriteMapElemValue()
  4108. }
  4109. ee.EncodeBool(v[int(k2)])
  4110. }
  4111. } else {
  4112. for k2, v2 := range v {
  4113. if esep {
  4114. ee.WriteMapElemKey()
  4115. }
  4116. ee.EncodeInt(int64(k2))
  4117. if esep {
  4118. ee.WriteMapElemValue()
  4119. }
  4120. ee.EncodeBool(v2)
  4121. }
  4122. }
  4123. ee.WriteMapEnd()
  4124. }
  4125. func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  4126. fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e)
  4127. }
  4128. func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) {
  4129. if v == nil {
  4130. e.e.EncodeNil()
  4131. return
  4132. }
  4133. ee, esep := e.e, e.hh.hasElemSeparators()
  4134. ee.WriteMapStart(len(v))
  4135. if e.h.Canonical {
  4136. v2 := make([]int64, len(v))
  4137. var i uint
  4138. for k := range v {
  4139. v2[i] = k
  4140. i++
  4141. }
  4142. sort.Sort(int64Slice(v2))
  4143. for _, k2 := range v2 {
  4144. if esep {
  4145. ee.WriteMapElemKey()
  4146. }
  4147. ee.EncodeInt(k2)
  4148. if esep {
  4149. ee.WriteMapElemValue()
  4150. }
  4151. e.encode(v[k2])
  4152. }
  4153. } else {
  4154. for k2, v2 := range v {
  4155. if esep {
  4156. ee.WriteMapElemKey()
  4157. }
  4158. ee.EncodeInt(k2)
  4159. if esep {
  4160. ee.WriteMapElemValue()
  4161. }
  4162. e.encode(v2)
  4163. }
  4164. }
  4165. ee.WriteMapEnd()
  4166. }
  4167. func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  4168. fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e)
  4169. }
  4170. func (_ fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) {
  4171. if v == nil {
  4172. e.e.EncodeNil()
  4173. return
  4174. }
  4175. ee, esep := e.e, e.hh.hasElemSeparators()
  4176. ee.WriteMapStart(len(v))
  4177. if e.h.Canonical {
  4178. v2 := make([]int64, len(v))
  4179. var i uint
  4180. for k := range v {
  4181. v2[i] = k
  4182. i++
  4183. }
  4184. sort.Sort(int64Slice(v2))
  4185. for _, k2 := range v2 {
  4186. if esep {
  4187. ee.WriteMapElemKey()
  4188. }
  4189. ee.EncodeInt(k2)
  4190. if esep {
  4191. ee.WriteMapElemValue()
  4192. }
  4193. if e.h.StringToRaw {
  4194. ee.EncodeStringBytesRaw(bytesView(v[k2]))
  4195. } else {
  4196. ee.EncodeStringEnc(cUTF8, v[k2])
  4197. }
  4198. }
  4199. } else {
  4200. for k2, v2 := range v {
  4201. if esep {
  4202. ee.WriteMapElemKey()
  4203. }
  4204. ee.EncodeInt(k2)
  4205. if esep {
  4206. ee.WriteMapElemValue()
  4207. }
  4208. if e.h.StringToRaw {
  4209. ee.EncodeStringBytesRaw(bytesView(v2))
  4210. } else {
  4211. ee.EncodeStringEnc(cUTF8, v2)
  4212. }
  4213. }
  4214. }
  4215. ee.WriteMapEnd()
  4216. }
  4217. func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  4218. fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e)
  4219. }
  4220. func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) {
  4221. if v == nil {
  4222. e.e.EncodeNil()
  4223. return
  4224. }
  4225. ee, esep := e.e, e.hh.hasElemSeparators()
  4226. ee.WriteMapStart(len(v))
  4227. if e.h.Canonical {
  4228. v2 := make([]int64, len(v))
  4229. var i uint
  4230. for k := range v {
  4231. v2[i] = k
  4232. i++
  4233. }
  4234. sort.Sort(int64Slice(v2))
  4235. for _, k2 := range v2 {
  4236. if esep {
  4237. ee.WriteMapElemKey()
  4238. }
  4239. ee.EncodeInt(k2)
  4240. if esep {
  4241. ee.WriteMapElemValue()
  4242. }
  4243. ee.EncodeUint(uint64(v[k2]))
  4244. }
  4245. } else {
  4246. for k2, v2 := range v {
  4247. if esep {
  4248. ee.WriteMapElemKey()
  4249. }
  4250. ee.EncodeInt(k2)
  4251. if esep {
  4252. ee.WriteMapElemValue()
  4253. }
  4254. ee.EncodeUint(uint64(v2))
  4255. }
  4256. }
  4257. ee.WriteMapEnd()
  4258. }
  4259. func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  4260. fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e)
  4261. }
  4262. func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) {
  4263. if v == nil {
  4264. e.e.EncodeNil()
  4265. return
  4266. }
  4267. ee, esep := e.e, e.hh.hasElemSeparators()
  4268. ee.WriteMapStart(len(v))
  4269. if e.h.Canonical {
  4270. v2 := make([]int64, len(v))
  4271. var i uint
  4272. for k := range v {
  4273. v2[i] = k
  4274. i++
  4275. }
  4276. sort.Sort(int64Slice(v2))
  4277. for _, k2 := range v2 {
  4278. if esep {
  4279. ee.WriteMapElemKey()
  4280. }
  4281. ee.EncodeInt(k2)
  4282. if esep {
  4283. ee.WriteMapElemValue()
  4284. }
  4285. ee.EncodeUint(uint64(v[k2]))
  4286. }
  4287. } else {
  4288. for k2, v2 := range v {
  4289. if esep {
  4290. ee.WriteMapElemKey()
  4291. }
  4292. ee.EncodeInt(k2)
  4293. if esep {
  4294. ee.WriteMapElemValue()
  4295. }
  4296. ee.EncodeUint(uint64(v2))
  4297. }
  4298. }
  4299. ee.WriteMapEnd()
  4300. }
  4301. func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  4302. fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e)
  4303. }
  4304. func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) {
  4305. if v == nil {
  4306. e.e.EncodeNil()
  4307. return
  4308. }
  4309. ee, esep := e.e, e.hh.hasElemSeparators()
  4310. ee.WriteMapStart(len(v))
  4311. if e.h.Canonical {
  4312. v2 := make([]int64, len(v))
  4313. var i uint
  4314. for k := range v {
  4315. v2[i] = k
  4316. i++
  4317. }
  4318. sort.Sort(int64Slice(v2))
  4319. for _, k2 := range v2 {
  4320. if esep {
  4321. ee.WriteMapElemKey()
  4322. }
  4323. ee.EncodeInt(k2)
  4324. if esep {
  4325. ee.WriteMapElemValue()
  4326. }
  4327. ee.EncodeUint(v[k2])
  4328. }
  4329. } else {
  4330. for k2, v2 := range v {
  4331. if esep {
  4332. ee.WriteMapElemKey()
  4333. }
  4334. ee.EncodeInt(k2)
  4335. if esep {
  4336. ee.WriteMapElemValue()
  4337. }
  4338. ee.EncodeUint(v2)
  4339. }
  4340. }
  4341. ee.WriteMapEnd()
  4342. }
  4343. func (e *Encoder) fastpathEncMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) {
  4344. fastpathTV.EncMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), e)
  4345. }
  4346. func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, e *Encoder) {
  4347. if v == nil {
  4348. e.e.EncodeNil()
  4349. return
  4350. }
  4351. ee, esep := e.e, e.hh.hasElemSeparators()
  4352. ee.WriteMapStart(len(v))
  4353. if e.h.Canonical {
  4354. v2 := make([]int64, len(v))
  4355. var i uint
  4356. for k := range v {
  4357. v2[i] = k
  4358. i++
  4359. }
  4360. sort.Sort(int64Slice(v2))
  4361. for _, k2 := range v2 {
  4362. if esep {
  4363. ee.WriteMapElemKey()
  4364. }
  4365. ee.EncodeInt(k2)
  4366. if esep {
  4367. ee.WriteMapElemValue()
  4368. }
  4369. e.encode(v[k2])
  4370. }
  4371. } else {
  4372. for k2, v2 := range v {
  4373. if esep {
  4374. ee.WriteMapElemKey()
  4375. }
  4376. ee.EncodeInt(k2)
  4377. if esep {
  4378. ee.WriteMapElemValue()
  4379. }
  4380. e.encode(v2)
  4381. }
  4382. }
  4383. ee.WriteMapEnd()
  4384. }
  4385. func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  4386. fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e)
  4387. }
  4388. func (_ fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) {
  4389. if v == nil {
  4390. e.e.EncodeNil()
  4391. return
  4392. }
  4393. ee, esep := e.e, e.hh.hasElemSeparators()
  4394. ee.WriteMapStart(len(v))
  4395. if e.h.Canonical {
  4396. v2 := make([]int64, len(v))
  4397. var i uint
  4398. for k := range v {
  4399. v2[i] = k
  4400. i++
  4401. }
  4402. sort.Sort(int64Slice(v2))
  4403. for _, k2 := range v2 {
  4404. if esep {
  4405. ee.WriteMapElemKey()
  4406. }
  4407. ee.EncodeInt(k2)
  4408. if esep {
  4409. ee.WriteMapElemValue()
  4410. }
  4411. ee.EncodeInt(int64(v[k2]))
  4412. }
  4413. } else {
  4414. for k2, v2 := range v {
  4415. if esep {
  4416. ee.WriteMapElemKey()
  4417. }
  4418. ee.EncodeInt(k2)
  4419. if esep {
  4420. ee.WriteMapElemValue()
  4421. }
  4422. ee.EncodeInt(int64(v2))
  4423. }
  4424. }
  4425. ee.WriteMapEnd()
  4426. }
  4427. func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  4428. fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e)
  4429. }
  4430. func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) {
  4431. if v == nil {
  4432. e.e.EncodeNil()
  4433. return
  4434. }
  4435. ee, esep := e.e, e.hh.hasElemSeparators()
  4436. ee.WriteMapStart(len(v))
  4437. if e.h.Canonical {
  4438. v2 := make([]int64, len(v))
  4439. var i uint
  4440. for k := range v {
  4441. v2[i] = k
  4442. i++
  4443. }
  4444. sort.Sort(int64Slice(v2))
  4445. for _, k2 := range v2 {
  4446. if esep {
  4447. ee.WriteMapElemKey()
  4448. }
  4449. ee.EncodeInt(k2)
  4450. if esep {
  4451. ee.WriteMapElemValue()
  4452. }
  4453. ee.EncodeInt(v[k2])
  4454. }
  4455. } else {
  4456. for k2, v2 := range v {
  4457. if esep {
  4458. ee.WriteMapElemKey()
  4459. }
  4460. ee.EncodeInt(k2)
  4461. if esep {
  4462. ee.WriteMapElemValue()
  4463. }
  4464. ee.EncodeInt(v2)
  4465. }
  4466. }
  4467. ee.WriteMapEnd()
  4468. }
  4469. func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  4470. fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e)
  4471. }
  4472. func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) {
  4473. if v == nil {
  4474. e.e.EncodeNil()
  4475. return
  4476. }
  4477. ee, esep := e.e, e.hh.hasElemSeparators()
  4478. ee.WriteMapStart(len(v))
  4479. if e.h.Canonical {
  4480. v2 := make([]int64, len(v))
  4481. var i uint
  4482. for k := range v {
  4483. v2[i] = k
  4484. i++
  4485. }
  4486. sort.Sort(int64Slice(v2))
  4487. for _, k2 := range v2 {
  4488. if esep {
  4489. ee.WriteMapElemKey()
  4490. }
  4491. ee.EncodeInt(k2)
  4492. if esep {
  4493. ee.WriteMapElemValue()
  4494. }
  4495. ee.EncodeFloat32(v[k2])
  4496. }
  4497. } else {
  4498. for k2, v2 := range v {
  4499. if esep {
  4500. ee.WriteMapElemKey()
  4501. }
  4502. ee.EncodeInt(k2)
  4503. if esep {
  4504. ee.WriteMapElemValue()
  4505. }
  4506. ee.EncodeFloat32(v2)
  4507. }
  4508. }
  4509. ee.WriteMapEnd()
  4510. }
  4511. func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  4512. fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e)
  4513. }
  4514. func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) {
  4515. if v == nil {
  4516. e.e.EncodeNil()
  4517. return
  4518. }
  4519. ee, esep := e.e, e.hh.hasElemSeparators()
  4520. ee.WriteMapStart(len(v))
  4521. if e.h.Canonical {
  4522. v2 := make([]int64, len(v))
  4523. var i uint
  4524. for k := range v {
  4525. v2[i] = k
  4526. i++
  4527. }
  4528. sort.Sort(int64Slice(v2))
  4529. for _, k2 := range v2 {
  4530. if esep {
  4531. ee.WriteMapElemKey()
  4532. }
  4533. ee.EncodeInt(k2)
  4534. if esep {
  4535. ee.WriteMapElemValue()
  4536. }
  4537. ee.EncodeFloat64(v[k2])
  4538. }
  4539. } else {
  4540. for k2, v2 := range v {
  4541. if esep {
  4542. ee.WriteMapElemKey()
  4543. }
  4544. ee.EncodeInt(k2)
  4545. if esep {
  4546. ee.WriteMapElemValue()
  4547. }
  4548. ee.EncodeFloat64(v2)
  4549. }
  4550. }
  4551. ee.WriteMapEnd()
  4552. }
  4553. func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  4554. fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e)
  4555. }
  4556. func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) {
  4557. if v == nil {
  4558. e.e.EncodeNil()
  4559. return
  4560. }
  4561. ee, esep := e.e, e.hh.hasElemSeparators()
  4562. ee.WriteMapStart(len(v))
  4563. if e.h.Canonical {
  4564. v2 := make([]int64, len(v))
  4565. var i uint
  4566. for k := range v {
  4567. v2[i] = k
  4568. i++
  4569. }
  4570. sort.Sort(int64Slice(v2))
  4571. for _, k2 := range v2 {
  4572. if esep {
  4573. ee.WriteMapElemKey()
  4574. }
  4575. ee.EncodeInt(k2)
  4576. if esep {
  4577. ee.WriteMapElemValue()
  4578. }
  4579. ee.EncodeBool(v[k2])
  4580. }
  4581. } else {
  4582. for k2, v2 := range v {
  4583. if esep {
  4584. ee.WriteMapElemKey()
  4585. }
  4586. ee.EncodeInt(k2)
  4587. if esep {
  4588. ee.WriteMapElemValue()
  4589. }
  4590. ee.EncodeBool(v2)
  4591. }
  4592. }
  4593. ee.WriteMapEnd()
  4594. }
  4595. // -- decode
  4596. // -- -- fast path type switch
  4597. func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {
  4598. var changed bool
  4599. switch v := iv.(type) {
  4600. case []interface{}:
  4601. var v2 []interface{}
  4602. v2, changed = fastpathTV.DecSliceIntfV(v, false, d)
  4603. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4604. copy(v, v2)
  4605. }
  4606. case *[]interface{}:
  4607. var v2 []interface{}
  4608. v2, changed = fastpathTV.DecSliceIntfV(*v, true, d)
  4609. if changed {
  4610. *v = v2
  4611. }
  4612. case []string:
  4613. var v2 []string
  4614. v2, changed = fastpathTV.DecSliceStringV(v, false, d)
  4615. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4616. copy(v, v2)
  4617. }
  4618. case *[]string:
  4619. var v2 []string
  4620. v2, changed = fastpathTV.DecSliceStringV(*v, true, d)
  4621. if changed {
  4622. *v = v2
  4623. }
  4624. case []float32:
  4625. var v2 []float32
  4626. v2, changed = fastpathTV.DecSliceFloat32V(v, false, d)
  4627. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4628. copy(v, v2)
  4629. }
  4630. case *[]float32:
  4631. var v2 []float32
  4632. v2, changed = fastpathTV.DecSliceFloat32V(*v, true, d)
  4633. if changed {
  4634. *v = v2
  4635. }
  4636. case []float64:
  4637. var v2 []float64
  4638. v2, changed = fastpathTV.DecSliceFloat64V(v, false, d)
  4639. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4640. copy(v, v2)
  4641. }
  4642. case *[]float64:
  4643. var v2 []float64
  4644. v2, changed = fastpathTV.DecSliceFloat64V(*v, true, d)
  4645. if changed {
  4646. *v = v2
  4647. }
  4648. case []uint:
  4649. var v2 []uint
  4650. v2, changed = fastpathTV.DecSliceUintV(v, false, d)
  4651. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4652. copy(v, v2)
  4653. }
  4654. case *[]uint:
  4655. var v2 []uint
  4656. v2, changed = fastpathTV.DecSliceUintV(*v, true, d)
  4657. if changed {
  4658. *v = v2
  4659. }
  4660. case []uint16:
  4661. var v2 []uint16
  4662. v2, changed = fastpathTV.DecSliceUint16V(v, false, d)
  4663. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4664. copy(v, v2)
  4665. }
  4666. case *[]uint16:
  4667. var v2 []uint16
  4668. v2, changed = fastpathTV.DecSliceUint16V(*v, true, d)
  4669. if changed {
  4670. *v = v2
  4671. }
  4672. case []uint32:
  4673. var v2 []uint32
  4674. v2, changed = fastpathTV.DecSliceUint32V(v, false, d)
  4675. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4676. copy(v, v2)
  4677. }
  4678. case *[]uint32:
  4679. var v2 []uint32
  4680. v2, changed = fastpathTV.DecSliceUint32V(*v, true, d)
  4681. if changed {
  4682. *v = v2
  4683. }
  4684. case []uint64:
  4685. var v2 []uint64
  4686. v2, changed = fastpathTV.DecSliceUint64V(v, false, d)
  4687. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4688. copy(v, v2)
  4689. }
  4690. case *[]uint64:
  4691. var v2 []uint64
  4692. v2, changed = fastpathTV.DecSliceUint64V(*v, true, d)
  4693. if changed {
  4694. *v = v2
  4695. }
  4696. case []uintptr:
  4697. var v2 []uintptr
  4698. v2, changed = fastpathTV.DecSliceUintptrV(v, false, d)
  4699. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4700. copy(v, v2)
  4701. }
  4702. case *[]uintptr:
  4703. var v2 []uintptr
  4704. v2, changed = fastpathTV.DecSliceUintptrV(*v, true, d)
  4705. if changed {
  4706. *v = v2
  4707. }
  4708. case []int:
  4709. var v2 []int
  4710. v2, changed = fastpathTV.DecSliceIntV(v, false, d)
  4711. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4712. copy(v, v2)
  4713. }
  4714. case *[]int:
  4715. var v2 []int
  4716. v2, changed = fastpathTV.DecSliceIntV(*v, true, d)
  4717. if changed {
  4718. *v = v2
  4719. }
  4720. case []int8:
  4721. var v2 []int8
  4722. v2, changed = fastpathTV.DecSliceInt8V(v, false, d)
  4723. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4724. copy(v, v2)
  4725. }
  4726. case *[]int8:
  4727. var v2 []int8
  4728. v2, changed = fastpathTV.DecSliceInt8V(*v, true, d)
  4729. if changed {
  4730. *v = v2
  4731. }
  4732. case []int16:
  4733. var v2 []int16
  4734. v2, changed = fastpathTV.DecSliceInt16V(v, false, d)
  4735. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4736. copy(v, v2)
  4737. }
  4738. case *[]int16:
  4739. var v2 []int16
  4740. v2, changed = fastpathTV.DecSliceInt16V(*v, true, d)
  4741. if changed {
  4742. *v = v2
  4743. }
  4744. case []int32:
  4745. var v2 []int32
  4746. v2, changed = fastpathTV.DecSliceInt32V(v, false, d)
  4747. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4748. copy(v, v2)
  4749. }
  4750. case *[]int32:
  4751. var v2 []int32
  4752. v2, changed = fastpathTV.DecSliceInt32V(*v, true, d)
  4753. if changed {
  4754. *v = v2
  4755. }
  4756. case []int64:
  4757. var v2 []int64
  4758. v2, changed = fastpathTV.DecSliceInt64V(v, false, d)
  4759. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4760. copy(v, v2)
  4761. }
  4762. case *[]int64:
  4763. var v2 []int64
  4764. v2, changed = fastpathTV.DecSliceInt64V(*v, true, d)
  4765. if changed {
  4766. *v = v2
  4767. }
  4768. case []bool:
  4769. var v2 []bool
  4770. v2, changed = fastpathTV.DecSliceBoolV(v, false, d)
  4771. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  4772. copy(v, v2)
  4773. }
  4774. case *[]bool:
  4775. var v2 []bool
  4776. v2, changed = fastpathTV.DecSliceBoolV(*v, true, d)
  4777. if changed {
  4778. *v = v2
  4779. }
  4780. case map[string]interface{}:
  4781. fastpathTV.DecMapStringIntfV(v, false, d)
  4782. case *map[string]interface{}:
  4783. var v2 map[string]interface{}
  4784. v2, changed = fastpathTV.DecMapStringIntfV(*v, true, d)
  4785. if changed {
  4786. *v = v2
  4787. }
  4788. case map[string]string:
  4789. fastpathTV.DecMapStringStringV(v, false, d)
  4790. case *map[string]string:
  4791. var v2 map[string]string
  4792. v2, changed = fastpathTV.DecMapStringStringV(*v, true, d)
  4793. if changed {
  4794. *v = v2
  4795. }
  4796. case map[string]uint:
  4797. fastpathTV.DecMapStringUintV(v, false, d)
  4798. case *map[string]uint:
  4799. var v2 map[string]uint
  4800. v2, changed = fastpathTV.DecMapStringUintV(*v, true, d)
  4801. if changed {
  4802. *v = v2
  4803. }
  4804. case map[string]uint8:
  4805. fastpathTV.DecMapStringUint8V(v, false, d)
  4806. case *map[string]uint8:
  4807. var v2 map[string]uint8
  4808. v2, changed = fastpathTV.DecMapStringUint8V(*v, true, d)
  4809. if changed {
  4810. *v = v2
  4811. }
  4812. case map[string]uint64:
  4813. fastpathTV.DecMapStringUint64V(v, false, d)
  4814. case *map[string]uint64:
  4815. var v2 map[string]uint64
  4816. v2, changed = fastpathTV.DecMapStringUint64V(*v, true, d)
  4817. if changed {
  4818. *v = v2
  4819. }
  4820. case map[string]uintptr:
  4821. fastpathTV.DecMapStringUintptrV(v, false, d)
  4822. case *map[string]uintptr:
  4823. var v2 map[string]uintptr
  4824. v2, changed = fastpathTV.DecMapStringUintptrV(*v, true, d)
  4825. if changed {
  4826. *v = v2
  4827. }
  4828. case map[string]int:
  4829. fastpathTV.DecMapStringIntV(v, false, d)
  4830. case *map[string]int:
  4831. var v2 map[string]int
  4832. v2, changed = fastpathTV.DecMapStringIntV(*v, true, d)
  4833. if changed {
  4834. *v = v2
  4835. }
  4836. case map[string]int64:
  4837. fastpathTV.DecMapStringInt64V(v, false, d)
  4838. case *map[string]int64:
  4839. var v2 map[string]int64
  4840. v2, changed = fastpathTV.DecMapStringInt64V(*v, true, d)
  4841. if changed {
  4842. *v = v2
  4843. }
  4844. case map[string]float32:
  4845. fastpathTV.DecMapStringFloat32V(v, false, d)
  4846. case *map[string]float32:
  4847. var v2 map[string]float32
  4848. v2, changed = fastpathTV.DecMapStringFloat32V(*v, true, d)
  4849. if changed {
  4850. *v = v2
  4851. }
  4852. case map[string]float64:
  4853. fastpathTV.DecMapStringFloat64V(v, false, d)
  4854. case *map[string]float64:
  4855. var v2 map[string]float64
  4856. v2, changed = fastpathTV.DecMapStringFloat64V(*v, true, d)
  4857. if changed {
  4858. *v = v2
  4859. }
  4860. case map[string]bool:
  4861. fastpathTV.DecMapStringBoolV(v, false, d)
  4862. case *map[string]bool:
  4863. var v2 map[string]bool
  4864. v2, changed = fastpathTV.DecMapStringBoolV(*v, true, d)
  4865. if changed {
  4866. *v = v2
  4867. }
  4868. case map[uint]interface{}:
  4869. fastpathTV.DecMapUintIntfV(v, false, d)
  4870. case *map[uint]interface{}:
  4871. var v2 map[uint]interface{}
  4872. v2, changed = fastpathTV.DecMapUintIntfV(*v, true, d)
  4873. if changed {
  4874. *v = v2
  4875. }
  4876. case map[uint]string:
  4877. fastpathTV.DecMapUintStringV(v, false, d)
  4878. case *map[uint]string:
  4879. var v2 map[uint]string
  4880. v2, changed = fastpathTV.DecMapUintStringV(*v, true, d)
  4881. if changed {
  4882. *v = v2
  4883. }
  4884. case map[uint]uint:
  4885. fastpathTV.DecMapUintUintV(v, false, d)
  4886. case *map[uint]uint:
  4887. var v2 map[uint]uint
  4888. v2, changed = fastpathTV.DecMapUintUintV(*v, true, d)
  4889. if changed {
  4890. *v = v2
  4891. }
  4892. case map[uint]uint8:
  4893. fastpathTV.DecMapUintUint8V(v, false, d)
  4894. case *map[uint]uint8:
  4895. var v2 map[uint]uint8
  4896. v2, changed = fastpathTV.DecMapUintUint8V(*v, true, d)
  4897. if changed {
  4898. *v = v2
  4899. }
  4900. case map[uint]uint64:
  4901. fastpathTV.DecMapUintUint64V(v, false, d)
  4902. case *map[uint]uint64:
  4903. var v2 map[uint]uint64
  4904. v2, changed = fastpathTV.DecMapUintUint64V(*v, true, d)
  4905. if changed {
  4906. *v = v2
  4907. }
  4908. case map[uint]uintptr:
  4909. fastpathTV.DecMapUintUintptrV(v, false, d)
  4910. case *map[uint]uintptr:
  4911. var v2 map[uint]uintptr
  4912. v2, changed = fastpathTV.DecMapUintUintptrV(*v, true, d)
  4913. if changed {
  4914. *v = v2
  4915. }
  4916. case map[uint]int:
  4917. fastpathTV.DecMapUintIntV(v, false, d)
  4918. case *map[uint]int:
  4919. var v2 map[uint]int
  4920. v2, changed = fastpathTV.DecMapUintIntV(*v, true, d)
  4921. if changed {
  4922. *v = v2
  4923. }
  4924. case map[uint]int64:
  4925. fastpathTV.DecMapUintInt64V(v, false, d)
  4926. case *map[uint]int64:
  4927. var v2 map[uint]int64
  4928. v2, changed = fastpathTV.DecMapUintInt64V(*v, true, d)
  4929. if changed {
  4930. *v = v2
  4931. }
  4932. case map[uint]float32:
  4933. fastpathTV.DecMapUintFloat32V(v, false, d)
  4934. case *map[uint]float32:
  4935. var v2 map[uint]float32
  4936. v2, changed = fastpathTV.DecMapUintFloat32V(*v, true, d)
  4937. if changed {
  4938. *v = v2
  4939. }
  4940. case map[uint]float64:
  4941. fastpathTV.DecMapUintFloat64V(v, false, d)
  4942. case *map[uint]float64:
  4943. var v2 map[uint]float64
  4944. v2, changed = fastpathTV.DecMapUintFloat64V(*v, true, d)
  4945. if changed {
  4946. *v = v2
  4947. }
  4948. case map[uint]bool:
  4949. fastpathTV.DecMapUintBoolV(v, false, d)
  4950. case *map[uint]bool:
  4951. var v2 map[uint]bool
  4952. v2, changed = fastpathTV.DecMapUintBoolV(*v, true, d)
  4953. if changed {
  4954. *v = v2
  4955. }
  4956. case map[uint8]interface{}:
  4957. fastpathTV.DecMapUint8IntfV(v, false, d)
  4958. case *map[uint8]interface{}:
  4959. var v2 map[uint8]interface{}
  4960. v2, changed = fastpathTV.DecMapUint8IntfV(*v, true, d)
  4961. if changed {
  4962. *v = v2
  4963. }
  4964. case map[uint8]string:
  4965. fastpathTV.DecMapUint8StringV(v, false, d)
  4966. case *map[uint8]string:
  4967. var v2 map[uint8]string
  4968. v2, changed = fastpathTV.DecMapUint8StringV(*v, true, d)
  4969. if changed {
  4970. *v = v2
  4971. }
  4972. case map[uint8]uint:
  4973. fastpathTV.DecMapUint8UintV(v, false, d)
  4974. case *map[uint8]uint:
  4975. var v2 map[uint8]uint
  4976. v2, changed = fastpathTV.DecMapUint8UintV(*v, true, d)
  4977. if changed {
  4978. *v = v2
  4979. }
  4980. case map[uint8]uint8:
  4981. fastpathTV.DecMapUint8Uint8V(v, false, d)
  4982. case *map[uint8]uint8:
  4983. var v2 map[uint8]uint8
  4984. v2, changed = fastpathTV.DecMapUint8Uint8V(*v, true, d)
  4985. if changed {
  4986. *v = v2
  4987. }
  4988. case map[uint8]uint64:
  4989. fastpathTV.DecMapUint8Uint64V(v, false, d)
  4990. case *map[uint8]uint64:
  4991. var v2 map[uint8]uint64
  4992. v2, changed = fastpathTV.DecMapUint8Uint64V(*v, true, d)
  4993. if changed {
  4994. *v = v2
  4995. }
  4996. case map[uint8]uintptr:
  4997. fastpathTV.DecMapUint8UintptrV(v, false, d)
  4998. case *map[uint8]uintptr:
  4999. var v2 map[uint8]uintptr
  5000. v2, changed = fastpathTV.DecMapUint8UintptrV(*v, true, d)
  5001. if changed {
  5002. *v = v2
  5003. }
  5004. case map[uint8]int:
  5005. fastpathTV.DecMapUint8IntV(v, false, d)
  5006. case *map[uint8]int:
  5007. var v2 map[uint8]int
  5008. v2, changed = fastpathTV.DecMapUint8IntV(*v, true, d)
  5009. if changed {
  5010. *v = v2
  5011. }
  5012. case map[uint8]int64:
  5013. fastpathTV.DecMapUint8Int64V(v, false, d)
  5014. case *map[uint8]int64:
  5015. var v2 map[uint8]int64
  5016. v2, changed = fastpathTV.DecMapUint8Int64V(*v, true, d)
  5017. if changed {
  5018. *v = v2
  5019. }
  5020. case map[uint8]float32:
  5021. fastpathTV.DecMapUint8Float32V(v, false, d)
  5022. case *map[uint8]float32:
  5023. var v2 map[uint8]float32
  5024. v2, changed = fastpathTV.DecMapUint8Float32V(*v, true, d)
  5025. if changed {
  5026. *v = v2
  5027. }
  5028. case map[uint8]float64:
  5029. fastpathTV.DecMapUint8Float64V(v, false, d)
  5030. case *map[uint8]float64:
  5031. var v2 map[uint8]float64
  5032. v2, changed = fastpathTV.DecMapUint8Float64V(*v, true, d)
  5033. if changed {
  5034. *v = v2
  5035. }
  5036. case map[uint8]bool:
  5037. fastpathTV.DecMapUint8BoolV(v, false, d)
  5038. case *map[uint8]bool:
  5039. var v2 map[uint8]bool
  5040. v2, changed = fastpathTV.DecMapUint8BoolV(*v, true, d)
  5041. if changed {
  5042. *v = v2
  5043. }
  5044. case map[uint64]interface{}:
  5045. fastpathTV.DecMapUint64IntfV(v, false, d)
  5046. case *map[uint64]interface{}:
  5047. var v2 map[uint64]interface{}
  5048. v2, changed = fastpathTV.DecMapUint64IntfV(*v, true, d)
  5049. if changed {
  5050. *v = v2
  5051. }
  5052. case map[uint64]string:
  5053. fastpathTV.DecMapUint64StringV(v, false, d)
  5054. case *map[uint64]string:
  5055. var v2 map[uint64]string
  5056. v2, changed = fastpathTV.DecMapUint64StringV(*v, true, d)
  5057. if changed {
  5058. *v = v2
  5059. }
  5060. case map[uint64]uint:
  5061. fastpathTV.DecMapUint64UintV(v, false, d)
  5062. case *map[uint64]uint:
  5063. var v2 map[uint64]uint
  5064. v2, changed = fastpathTV.DecMapUint64UintV(*v, true, d)
  5065. if changed {
  5066. *v = v2
  5067. }
  5068. case map[uint64]uint8:
  5069. fastpathTV.DecMapUint64Uint8V(v, false, d)
  5070. case *map[uint64]uint8:
  5071. var v2 map[uint64]uint8
  5072. v2, changed = fastpathTV.DecMapUint64Uint8V(*v, true, d)
  5073. if changed {
  5074. *v = v2
  5075. }
  5076. case map[uint64]uint64:
  5077. fastpathTV.DecMapUint64Uint64V(v, false, d)
  5078. case *map[uint64]uint64:
  5079. var v2 map[uint64]uint64
  5080. v2, changed = fastpathTV.DecMapUint64Uint64V(*v, true, d)
  5081. if changed {
  5082. *v = v2
  5083. }
  5084. case map[uint64]uintptr:
  5085. fastpathTV.DecMapUint64UintptrV(v, false, d)
  5086. case *map[uint64]uintptr:
  5087. var v2 map[uint64]uintptr
  5088. v2, changed = fastpathTV.DecMapUint64UintptrV(*v, true, d)
  5089. if changed {
  5090. *v = v2
  5091. }
  5092. case map[uint64]int:
  5093. fastpathTV.DecMapUint64IntV(v, false, d)
  5094. case *map[uint64]int:
  5095. var v2 map[uint64]int
  5096. v2, changed = fastpathTV.DecMapUint64IntV(*v, true, d)
  5097. if changed {
  5098. *v = v2
  5099. }
  5100. case map[uint64]int64:
  5101. fastpathTV.DecMapUint64Int64V(v, false, d)
  5102. case *map[uint64]int64:
  5103. var v2 map[uint64]int64
  5104. v2, changed = fastpathTV.DecMapUint64Int64V(*v, true, d)
  5105. if changed {
  5106. *v = v2
  5107. }
  5108. case map[uint64]float32:
  5109. fastpathTV.DecMapUint64Float32V(v, false, d)
  5110. case *map[uint64]float32:
  5111. var v2 map[uint64]float32
  5112. v2, changed = fastpathTV.DecMapUint64Float32V(*v, true, d)
  5113. if changed {
  5114. *v = v2
  5115. }
  5116. case map[uint64]float64:
  5117. fastpathTV.DecMapUint64Float64V(v, false, d)
  5118. case *map[uint64]float64:
  5119. var v2 map[uint64]float64
  5120. v2, changed = fastpathTV.DecMapUint64Float64V(*v, true, d)
  5121. if changed {
  5122. *v = v2
  5123. }
  5124. case map[uint64]bool:
  5125. fastpathTV.DecMapUint64BoolV(v, false, d)
  5126. case *map[uint64]bool:
  5127. var v2 map[uint64]bool
  5128. v2, changed = fastpathTV.DecMapUint64BoolV(*v, true, d)
  5129. if changed {
  5130. *v = v2
  5131. }
  5132. case map[uintptr]interface{}:
  5133. fastpathTV.DecMapUintptrIntfV(v, false, d)
  5134. case *map[uintptr]interface{}:
  5135. var v2 map[uintptr]interface{}
  5136. v2, changed = fastpathTV.DecMapUintptrIntfV(*v, true, d)
  5137. if changed {
  5138. *v = v2
  5139. }
  5140. case map[uintptr]string:
  5141. fastpathTV.DecMapUintptrStringV(v, false, d)
  5142. case *map[uintptr]string:
  5143. var v2 map[uintptr]string
  5144. v2, changed = fastpathTV.DecMapUintptrStringV(*v, true, d)
  5145. if changed {
  5146. *v = v2
  5147. }
  5148. case map[uintptr]uint:
  5149. fastpathTV.DecMapUintptrUintV(v, false, d)
  5150. case *map[uintptr]uint:
  5151. var v2 map[uintptr]uint
  5152. v2, changed = fastpathTV.DecMapUintptrUintV(*v, true, d)
  5153. if changed {
  5154. *v = v2
  5155. }
  5156. case map[uintptr]uint8:
  5157. fastpathTV.DecMapUintptrUint8V(v, false, d)
  5158. case *map[uintptr]uint8:
  5159. var v2 map[uintptr]uint8
  5160. v2, changed = fastpathTV.DecMapUintptrUint8V(*v, true, d)
  5161. if changed {
  5162. *v = v2
  5163. }
  5164. case map[uintptr]uint64:
  5165. fastpathTV.DecMapUintptrUint64V(v, false, d)
  5166. case *map[uintptr]uint64:
  5167. var v2 map[uintptr]uint64
  5168. v2, changed = fastpathTV.DecMapUintptrUint64V(*v, true, d)
  5169. if changed {
  5170. *v = v2
  5171. }
  5172. case map[uintptr]uintptr:
  5173. fastpathTV.DecMapUintptrUintptrV(v, false, d)
  5174. case *map[uintptr]uintptr:
  5175. var v2 map[uintptr]uintptr
  5176. v2, changed = fastpathTV.DecMapUintptrUintptrV(*v, true, d)
  5177. if changed {
  5178. *v = v2
  5179. }
  5180. case map[uintptr]int:
  5181. fastpathTV.DecMapUintptrIntV(v, false, d)
  5182. case *map[uintptr]int:
  5183. var v2 map[uintptr]int
  5184. v2, changed = fastpathTV.DecMapUintptrIntV(*v, true, d)
  5185. if changed {
  5186. *v = v2
  5187. }
  5188. case map[uintptr]int64:
  5189. fastpathTV.DecMapUintptrInt64V(v, false, d)
  5190. case *map[uintptr]int64:
  5191. var v2 map[uintptr]int64
  5192. v2, changed = fastpathTV.DecMapUintptrInt64V(*v, true, d)
  5193. if changed {
  5194. *v = v2
  5195. }
  5196. case map[uintptr]float32:
  5197. fastpathTV.DecMapUintptrFloat32V(v, false, d)
  5198. case *map[uintptr]float32:
  5199. var v2 map[uintptr]float32
  5200. v2, changed = fastpathTV.DecMapUintptrFloat32V(*v, true, d)
  5201. if changed {
  5202. *v = v2
  5203. }
  5204. case map[uintptr]float64:
  5205. fastpathTV.DecMapUintptrFloat64V(v, false, d)
  5206. case *map[uintptr]float64:
  5207. var v2 map[uintptr]float64
  5208. v2, changed = fastpathTV.DecMapUintptrFloat64V(*v, true, d)
  5209. if changed {
  5210. *v = v2
  5211. }
  5212. case map[uintptr]bool:
  5213. fastpathTV.DecMapUintptrBoolV(v, false, d)
  5214. case *map[uintptr]bool:
  5215. var v2 map[uintptr]bool
  5216. v2, changed = fastpathTV.DecMapUintptrBoolV(*v, true, d)
  5217. if changed {
  5218. *v = v2
  5219. }
  5220. case map[int]interface{}:
  5221. fastpathTV.DecMapIntIntfV(v, false, d)
  5222. case *map[int]interface{}:
  5223. var v2 map[int]interface{}
  5224. v2, changed = fastpathTV.DecMapIntIntfV(*v, true, d)
  5225. if changed {
  5226. *v = v2
  5227. }
  5228. case map[int]string:
  5229. fastpathTV.DecMapIntStringV(v, false, d)
  5230. case *map[int]string:
  5231. var v2 map[int]string
  5232. v2, changed = fastpathTV.DecMapIntStringV(*v, true, d)
  5233. if changed {
  5234. *v = v2
  5235. }
  5236. case map[int]uint:
  5237. fastpathTV.DecMapIntUintV(v, false, d)
  5238. case *map[int]uint:
  5239. var v2 map[int]uint
  5240. v2, changed = fastpathTV.DecMapIntUintV(*v, true, d)
  5241. if changed {
  5242. *v = v2
  5243. }
  5244. case map[int]uint8:
  5245. fastpathTV.DecMapIntUint8V(v, false, d)
  5246. case *map[int]uint8:
  5247. var v2 map[int]uint8
  5248. v2, changed = fastpathTV.DecMapIntUint8V(*v, true, d)
  5249. if changed {
  5250. *v = v2
  5251. }
  5252. case map[int]uint64:
  5253. fastpathTV.DecMapIntUint64V(v, false, d)
  5254. case *map[int]uint64:
  5255. var v2 map[int]uint64
  5256. v2, changed = fastpathTV.DecMapIntUint64V(*v, true, d)
  5257. if changed {
  5258. *v = v2
  5259. }
  5260. case map[int]uintptr:
  5261. fastpathTV.DecMapIntUintptrV(v, false, d)
  5262. case *map[int]uintptr:
  5263. var v2 map[int]uintptr
  5264. v2, changed = fastpathTV.DecMapIntUintptrV(*v, true, d)
  5265. if changed {
  5266. *v = v2
  5267. }
  5268. case map[int]int:
  5269. fastpathTV.DecMapIntIntV(v, false, d)
  5270. case *map[int]int:
  5271. var v2 map[int]int
  5272. v2, changed = fastpathTV.DecMapIntIntV(*v, true, d)
  5273. if changed {
  5274. *v = v2
  5275. }
  5276. case map[int]int64:
  5277. fastpathTV.DecMapIntInt64V(v, false, d)
  5278. case *map[int]int64:
  5279. var v2 map[int]int64
  5280. v2, changed = fastpathTV.DecMapIntInt64V(*v, true, d)
  5281. if changed {
  5282. *v = v2
  5283. }
  5284. case map[int]float32:
  5285. fastpathTV.DecMapIntFloat32V(v, false, d)
  5286. case *map[int]float32:
  5287. var v2 map[int]float32
  5288. v2, changed = fastpathTV.DecMapIntFloat32V(*v, true, d)
  5289. if changed {
  5290. *v = v2
  5291. }
  5292. case map[int]float64:
  5293. fastpathTV.DecMapIntFloat64V(v, false, d)
  5294. case *map[int]float64:
  5295. var v2 map[int]float64
  5296. v2, changed = fastpathTV.DecMapIntFloat64V(*v, true, d)
  5297. if changed {
  5298. *v = v2
  5299. }
  5300. case map[int]bool:
  5301. fastpathTV.DecMapIntBoolV(v, false, d)
  5302. case *map[int]bool:
  5303. var v2 map[int]bool
  5304. v2, changed = fastpathTV.DecMapIntBoolV(*v, true, d)
  5305. if changed {
  5306. *v = v2
  5307. }
  5308. case map[int64]interface{}:
  5309. fastpathTV.DecMapInt64IntfV(v, false, d)
  5310. case *map[int64]interface{}:
  5311. var v2 map[int64]interface{}
  5312. v2, changed = fastpathTV.DecMapInt64IntfV(*v, true, d)
  5313. if changed {
  5314. *v = v2
  5315. }
  5316. case map[int64]string:
  5317. fastpathTV.DecMapInt64StringV(v, false, d)
  5318. case *map[int64]string:
  5319. var v2 map[int64]string
  5320. v2, changed = fastpathTV.DecMapInt64StringV(*v, true, d)
  5321. if changed {
  5322. *v = v2
  5323. }
  5324. case map[int64]uint:
  5325. fastpathTV.DecMapInt64UintV(v, false, d)
  5326. case *map[int64]uint:
  5327. var v2 map[int64]uint
  5328. v2, changed = fastpathTV.DecMapInt64UintV(*v, true, d)
  5329. if changed {
  5330. *v = v2
  5331. }
  5332. case map[int64]uint8:
  5333. fastpathTV.DecMapInt64Uint8V(v, false, d)
  5334. case *map[int64]uint8:
  5335. var v2 map[int64]uint8
  5336. v2, changed = fastpathTV.DecMapInt64Uint8V(*v, true, d)
  5337. if changed {
  5338. *v = v2
  5339. }
  5340. case map[int64]uint64:
  5341. fastpathTV.DecMapInt64Uint64V(v, false, d)
  5342. case *map[int64]uint64:
  5343. var v2 map[int64]uint64
  5344. v2, changed = fastpathTV.DecMapInt64Uint64V(*v, true, d)
  5345. if changed {
  5346. *v = v2
  5347. }
  5348. case map[int64]uintptr:
  5349. fastpathTV.DecMapInt64UintptrV(v, false, d)
  5350. case *map[int64]uintptr:
  5351. var v2 map[int64]uintptr
  5352. v2, changed = fastpathTV.DecMapInt64UintptrV(*v, true, d)
  5353. if changed {
  5354. *v = v2
  5355. }
  5356. case map[int64]int:
  5357. fastpathTV.DecMapInt64IntV(v, false, d)
  5358. case *map[int64]int:
  5359. var v2 map[int64]int
  5360. v2, changed = fastpathTV.DecMapInt64IntV(*v, true, d)
  5361. if changed {
  5362. *v = v2
  5363. }
  5364. case map[int64]int64:
  5365. fastpathTV.DecMapInt64Int64V(v, false, d)
  5366. case *map[int64]int64:
  5367. var v2 map[int64]int64
  5368. v2, changed = fastpathTV.DecMapInt64Int64V(*v, true, d)
  5369. if changed {
  5370. *v = v2
  5371. }
  5372. case map[int64]float32:
  5373. fastpathTV.DecMapInt64Float32V(v, false, d)
  5374. case *map[int64]float32:
  5375. var v2 map[int64]float32
  5376. v2, changed = fastpathTV.DecMapInt64Float32V(*v, true, d)
  5377. if changed {
  5378. *v = v2
  5379. }
  5380. case map[int64]float64:
  5381. fastpathTV.DecMapInt64Float64V(v, false, d)
  5382. case *map[int64]float64:
  5383. var v2 map[int64]float64
  5384. v2, changed = fastpathTV.DecMapInt64Float64V(*v, true, d)
  5385. if changed {
  5386. *v = v2
  5387. }
  5388. case map[int64]bool:
  5389. fastpathTV.DecMapInt64BoolV(v, false, d)
  5390. case *map[int64]bool:
  5391. var v2 map[int64]bool
  5392. v2, changed = fastpathTV.DecMapInt64BoolV(*v, true, d)
  5393. if changed {
  5394. *v = v2
  5395. }
  5396. default:
  5397. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  5398. return false
  5399. }
  5400. return true
  5401. }
  5402. func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool {
  5403. switch v := iv.(type) {
  5404. case *[]interface{}:
  5405. *v = nil
  5406. case *[]string:
  5407. *v = nil
  5408. case *[]float32:
  5409. *v = nil
  5410. case *[]float64:
  5411. *v = nil
  5412. case *[]uint:
  5413. *v = nil
  5414. case *[]uint8:
  5415. *v = nil
  5416. case *[]uint16:
  5417. *v = nil
  5418. case *[]uint32:
  5419. *v = nil
  5420. case *[]uint64:
  5421. *v = nil
  5422. case *[]uintptr:
  5423. *v = nil
  5424. case *[]int:
  5425. *v = nil
  5426. case *[]int8:
  5427. *v = nil
  5428. case *[]int16:
  5429. *v = nil
  5430. case *[]int32:
  5431. *v = nil
  5432. case *[]int64:
  5433. *v = nil
  5434. case *[]bool:
  5435. *v = nil
  5436. case *map[string]interface{}:
  5437. *v = nil
  5438. case *map[string]string:
  5439. *v = nil
  5440. case *map[string]uint:
  5441. *v = nil
  5442. case *map[string]uint8:
  5443. *v = nil
  5444. case *map[string]uint64:
  5445. *v = nil
  5446. case *map[string]uintptr:
  5447. *v = nil
  5448. case *map[string]int:
  5449. *v = nil
  5450. case *map[string]int64:
  5451. *v = nil
  5452. case *map[string]float32:
  5453. *v = nil
  5454. case *map[string]float64:
  5455. *v = nil
  5456. case *map[string]bool:
  5457. *v = nil
  5458. case *map[uint]interface{}:
  5459. *v = nil
  5460. case *map[uint]string:
  5461. *v = nil
  5462. case *map[uint]uint:
  5463. *v = nil
  5464. case *map[uint]uint8:
  5465. *v = nil
  5466. case *map[uint]uint64:
  5467. *v = nil
  5468. case *map[uint]uintptr:
  5469. *v = nil
  5470. case *map[uint]int:
  5471. *v = nil
  5472. case *map[uint]int64:
  5473. *v = nil
  5474. case *map[uint]float32:
  5475. *v = nil
  5476. case *map[uint]float64:
  5477. *v = nil
  5478. case *map[uint]bool:
  5479. *v = nil
  5480. case *map[uint8]interface{}:
  5481. *v = nil
  5482. case *map[uint8]string:
  5483. *v = nil
  5484. case *map[uint8]uint:
  5485. *v = nil
  5486. case *map[uint8]uint8:
  5487. *v = nil
  5488. case *map[uint8]uint64:
  5489. *v = nil
  5490. case *map[uint8]uintptr:
  5491. *v = nil
  5492. case *map[uint8]int:
  5493. *v = nil
  5494. case *map[uint8]int64:
  5495. *v = nil
  5496. case *map[uint8]float32:
  5497. *v = nil
  5498. case *map[uint8]float64:
  5499. *v = nil
  5500. case *map[uint8]bool:
  5501. *v = nil
  5502. case *map[uint64]interface{}:
  5503. *v = nil
  5504. case *map[uint64]string:
  5505. *v = nil
  5506. case *map[uint64]uint:
  5507. *v = nil
  5508. case *map[uint64]uint8:
  5509. *v = nil
  5510. case *map[uint64]uint64:
  5511. *v = nil
  5512. case *map[uint64]uintptr:
  5513. *v = nil
  5514. case *map[uint64]int:
  5515. *v = nil
  5516. case *map[uint64]int64:
  5517. *v = nil
  5518. case *map[uint64]float32:
  5519. *v = nil
  5520. case *map[uint64]float64:
  5521. *v = nil
  5522. case *map[uint64]bool:
  5523. *v = nil
  5524. case *map[uintptr]interface{}:
  5525. *v = nil
  5526. case *map[uintptr]string:
  5527. *v = nil
  5528. case *map[uintptr]uint:
  5529. *v = nil
  5530. case *map[uintptr]uint8:
  5531. *v = nil
  5532. case *map[uintptr]uint64:
  5533. *v = nil
  5534. case *map[uintptr]uintptr:
  5535. *v = nil
  5536. case *map[uintptr]int:
  5537. *v = nil
  5538. case *map[uintptr]int64:
  5539. *v = nil
  5540. case *map[uintptr]float32:
  5541. *v = nil
  5542. case *map[uintptr]float64:
  5543. *v = nil
  5544. case *map[uintptr]bool:
  5545. *v = nil
  5546. case *map[int]interface{}:
  5547. *v = nil
  5548. case *map[int]string:
  5549. *v = nil
  5550. case *map[int]uint:
  5551. *v = nil
  5552. case *map[int]uint8:
  5553. *v = nil
  5554. case *map[int]uint64:
  5555. *v = nil
  5556. case *map[int]uintptr:
  5557. *v = nil
  5558. case *map[int]int:
  5559. *v = nil
  5560. case *map[int]int64:
  5561. *v = nil
  5562. case *map[int]float32:
  5563. *v = nil
  5564. case *map[int]float64:
  5565. *v = nil
  5566. case *map[int]bool:
  5567. *v = nil
  5568. case *map[int64]interface{}:
  5569. *v = nil
  5570. case *map[int64]string:
  5571. *v = nil
  5572. case *map[int64]uint:
  5573. *v = nil
  5574. case *map[int64]uint8:
  5575. *v = nil
  5576. case *map[int64]uint64:
  5577. *v = nil
  5578. case *map[int64]uintptr:
  5579. *v = nil
  5580. case *map[int64]int:
  5581. *v = nil
  5582. case *map[int64]int64:
  5583. *v = nil
  5584. case *map[int64]float32:
  5585. *v = nil
  5586. case *map[int64]float64:
  5587. *v = nil
  5588. case *map[int64]bool:
  5589. *v = nil
  5590. default:
  5591. _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4
  5592. return false
  5593. }
  5594. return true
  5595. }
  5596. // -- -- fast path functions
  5597. func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) {
  5598. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5599. vp := rv2i(rv).(*[]interface{})
  5600. v, changed := fastpathTV.DecSliceIntfV(*vp, !array, d)
  5601. if changed {
  5602. *vp = v
  5603. }
  5604. } else {
  5605. v := rv2i(rv).([]interface{})
  5606. v2, changed := fastpathTV.DecSliceIntfV(v, !array, d)
  5607. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5608. copy(v, v2)
  5609. }
  5610. }
  5611. }
  5612. func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) {
  5613. v, changed := f.DecSliceIntfV(*vp, true, d)
  5614. if changed {
  5615. *vp = v
  5616. }
  5617. }
  5618. func (_ fastpathT) DecSliceIntfV(v []interface{}, canChange bool, d *Decoder) (_ []interface{}, changed bool) {
  5619. dd := d.d
  5620. slh, containerLenS := d.decSliceHelperStart()
  5621. if containerLenS == 0 {
  5622. if canChange {
  5623. if v == nil {
  5624. v = []interface{}{}
  5625. } else if len(v) != 0 {
  5626. v = v[:0]
  5627. }
  5628. changed = true
  5629. }
  5630. slh.End()
  5631. return v, changed
  5632. }
  5633. d.depthIncr()
  5634. hasLen := containerLenS > 0
  5635. var xlen int
  5636. if hasLen && canChange {
  5637. if containerLenS > cap(v) {
  5638. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5639. if xlen <= cap(v) {
  5640. v = v[:uint(xlen)]
  5641. } else {
  5642. v = make([]interface{}, uint(xlen))
  5643. }
  5644. changed = true
  5645. } else if containerLenS != len(v) {
  5646. v = v[:containerLenS]
  5647. changed = true
  5648. }
  5649. }
  5650. var j int
  5651. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  5652. if j == 0 && len(v) == 0 && canChange {
  5653. if hasLen {
  5654. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5655. } else {
  5656. xlen = 8
  5657. }
  5658. v = make([]interface{}, uint(xlen))
  5659. changed = true
  5660. }
  5661. // if indefinite, etc, then expand the slice if necessary
  5662. var decodeIntoBlank bool
  5663. if j >= len(v) {
  5664. if canChange {
  5665. v = append(v, nil)
  5666. changed = true
  5667. } else {
  5668. d.arrayCannotExpand(len(v), j+1)
  5669. decodeIntoBlank = true
  5670. }
  5671. }
  5672. slh.ElemContainerState(j)
  5673. if decodeIntoBlank {
  5674. d.swallow()
  5675. } else if dd.TryDecodeAsNil() {
  5676. v[uint(j)] = nil
  5677. } else {
  5678. d.decode(&v[uint(j)])
  5679. }
  5680. }
  5681. if canChange {
  5682. if j < len(v) {
  5683. v = v[:uint(j)]
  5684. changed = true
  5685. } else if j == 0 && v == nil {
  5686. v = make([]interface{}, 0)
  5687. changed = true
  5688. }
  5689. }
  5690. slh.End()
  5691. d.depthDecr()
  5692. return v, changed
  5693. }
  5694. func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) {
  5695. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5696. vp := rv2i(rv).(*[]string)
  5697. v, changed := fastpathTV.DecSliceStringV(*vp, !array, d)
  5698. if changed {
  5699. *vp = v
  5700. }
  5701. } else {
  5702. v := rv2i(rv).([]string)
  5703. v2, changed := fastpathTV.DecSliceStringV(v, !array, d)
  5704. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5705. copy(v, v2)
  5706. }
  5707. }
  5708. }
  5709. func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) {
  5710. v, changed := f.DecSliceStringV(*vp, true, d)
  5711. if changed {
  5712. *vp = v
  5713. }
  5714. }
  5715. func (_ fastpathT) DecSliceStringV(v []string, canChange bool, d *Decoder) (_ []string, changed bool) {
  5716. dd := d.d
  5717. slh, containerLenS := d.decSliceHelperStart()
  5718. if containerLenS == 0 {
  5719. if canChange {
  5720. if v == nil {
  5721. v = []string{}
  5722. } else if len(v) != 0 {
  5723. v = v[:0]
  5724. }
  5725. changed = true
  5726. }
  5727. slh.End()
  5728. return v, changed
  5729. }
  5730. d.depthIncr()
  5731. hasLen := containerLenS > 0
  5732. var xlen int
  5733. if hasLen && canChange {
  5734. if containerLenS > cap(v) {
  5735. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5736. if xlen <= cap(v) {
  5737. v = v[:uint(xlen)]
  5738. } else {
  5739. v = make([]string, uint(xlen))
  5740. }
  5741. changed = true
  5742. } else if containerLenS != len(v) {
  5743. v = v[:containerLenS]
  5744. changed = true
  5745. }
  5746. }
  5747. var j int
  5748. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  5749. if j == 0 && len(v) == 0 && canChange {
  5750. if hasLen {
  5751. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  5752. } else {
  5753. xlen = 8
  5754. }
  5755. v = make([]string, uint(xlen))
  5756. changed = true
  5757. }
  5758. // if indefinite, etc, then expand the slice if necessary
  5759. var decodeIntoBlank bool
  5760. if j >= len(v) {
  5761. if canChange {
  5762. v = append(v, "")
  5763. changed = true
  5764. } else {
  5765. d.arrayCannotExpand(len(v), j+1)
  5766. decodeIntoBlank = true
  5767. }
  5768. }
  5769. slh.ElemContainerState(j)
  5770. if decodeIntoBlank {
  5771. d.swallow()
  5772. } else if dd.TryDecodeAsNil() {
  5773. v[uint(j)] = ""
  5774. } else {
  5775. v[uint(j)] = dd.DecodeString()
  5776. }
  5777. }
  5778. if canChange {
  5779. if j < len(v) {
  5780. v = v[:uint(j)]
  5781. changed = true
  5782. } else if j == 0 && v == nil {
  5783. v = make([]string, 0)
  5784. changed = true
  5785. }
  5786. }
  5787. slh.End()
  5788. d.depthDecr()
  5789. return v, changed
  5790. }
  5791. func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  5792. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5793. vp := rv2i(rv).(*[]float32)
  5794. v, changed := fastpathTV.DecSliceFloat32V(*vp, !array, d)
  5795. if changed {
  5796. *vp = v
  5797. }
  5798. } else {
  5799. v := rv2i(rv).([]float32)
  5800. v2, changed := fastpathTV.DecSliceFloat32V(v, !array, d)
  5801. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5802. copy(v, v2)
  5803. }
  5804. }
  5805. }
  5806. func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) {
  5807. v, changed := f.DecSliceFloat32V(*vp, true, d)
  5808. if changed {
  5809. *vp = v
  5810. }
  5811. }
  5812. func (_ fastpathT) DecSliceFloat32V(v []float32, canChange bool, d *Decoder) (_ []float32, changed bool) {
  5813. dd := d.d
  5814. slh, containerLenS := d.decSliceHelperStart()
  5815. if containerLenS == 0 {
  5816. if canChange {
  5817. if v == nil {
  5818. v = []float32{}
  5819. } else if len(v) != 0 {
  5820. v = v[:0]
  5821. }
  5822. changed = true
  5823. }
  5824. slh.End()
  5825. return v, changed
  5826. }
  5827. d.depthIncr()
  5828. hasLen := containerLenS > 0
  5829. var xlen int
  5830. if hasLen && canChange {
  5831. if containerLenS > cap(v) {
  5832. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5833. if xlen <= cap(v) {
  5834. v = v[:uint(xlen)]
  5835. } else {
  5836. v = make([]float32, uint(xlen))
  5837. }
  5838. changed = true
  5839. } else if containerLenS != len(v) {
  5840. v = v[:containerLenS]
  5841. changed = true
  5842. }
  5843. }
  5844. var j int
  5845. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  5846. if j == 0 && len(v) == 0 && canChange {
  5847. if hasLen {
  5848. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5849. } else {
  5850. xlen = 8
  5851. }
  5852. v = make([]float32, uint(xlen))
  5853. changed = true
  5854. }
  5855. // if indefinite, etc, then expand the slice if necessary
  5856. var decodeIntoBlank bool
  5857. if j >= len(v) {
  5858. if canChange {
  5859. v = append(v, 0)
  5860. changed = true
  5861. } else {
  5862. d.arrayCannotExpand(len(v), j+1)
  5863. decodeIntoBlank = true
  5864. }
  5865. }
  5866. slh.ElemContainerState(j)
  5867. if decodeIntoBlank {
  5868. d.swallow()
  5869. } else if dd.TryDecodeAsNil() {
  5870. v[uint(j)] = 0
  5871. } else {
  5872. v[uint(j)] = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  5873. }
  5874. }
  5875. if canChange {
  5876. if j < len(v) {
  5877. v = v[:uint(j)]
  5878. changed = true
  5879. } else if j == 0 && v == nil {
  5880. v = make([]float32, 0)
  5881. changed = true
  5882. }
  5883. }
  5884. slh.End()
  5885. d.depthDecr()
  5886. return v, changed
  5887. }
  5888. func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  5889. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5890. vp := rv2i(rv).(*[]float64)
  5891. v, changed := fastpathTV.DecSliceFloat64V(*vp, !array, d)
  5892. if changed {
  5893. *vp = v
  5894. }
  5895. } else {
  5896. v := rv2i(rv).([]float64)
  5897. v2, changed := fastpathTV.DecSliceFloat64V(v, !array, d)
  5898. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5899. copy(v, v2)
  5900. }
  5901. }
  5902. }
  5903. func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) {
  5904. v, changed := f.DecSliceFloat64V(*vp, true, d)
  5905. if changed {
  5906. *vp = v
  5907. }
  5908. }
  5909. func (_ fastpathT) DecSliceFloat64V(v []float64, canChange bool, d *Decoder) (_ []float64, changed bool) {
  5910. dd := d.d
  5911. slh, containerLenS := d.decSliceHelperStart()
  5912. if containerLenS == 0 {
  5913. if canChange {
  5914. if v == nil {
  5915. v = []float64{}
  5916. } else if len(v) != 0 {
  5917. v = v[:0]
  5918. }
  5919. changed = true
  5920. }
  5921. slh.End()
  5922. return v, changed
  5923. }
  5924. d.depthIncr()
  5925. hasLen := containerLenS > 0
  5926. var xlen int
  5927. if hasLen && canChange {
  5928. if containerLenS > cap(v) {
  5929. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5930. if xlen <= cap(v) {
  5931. v = v[:uint(xlen)]
  5932. } else {
  5933. v = make([]float64, uint(xlen))
  5934. }
  5935. changed = true
  5936. } else if containerLenS != len(v) {
  5937. v = v[:containerLenS]
  5938. changed = true
  5939. }
  5940. }
  5941. var j int
  5942. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  5943. if j == 0 && len(v) == 0 && canChange {
  5944. if hasLen {
  5945. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5946. } else {
  5947. xlen = 8
  5948. }
  5949. v = make([]float64, uint(xlen))
  5950. changed = true
  5951. }
  5952. // if indefinite, etc, then expand the slice if necessary
  5953. var decodeIntoBlank bool
  5954. if j >= len(v) {
  5955. if canChange {
  5956. v = append(v, 0)
  5957. changed = true
  5958. } else {
  5959. d.arrayCannotExpand(len(v), j+1)
  5960. decodeIntoBlank = true
  5961. }
  5962. }
  5963. slh.ElemContainerState(j)
  5964. if decodeIntoBlank {
  5965. d.swallow()
  5966. } else if dd.TryDecodeAsNil() {
  5967. v[uint(j)] = 0
  5968. } else {
  5969. v[uint(j)] = dd.DecodeFloat64()
  5970. }
  5971. }
  5972. if canChange {
  5973. if j < len(v) {
  5974. v = v[:uint(j)]
  5975. changed = true
  5976. } else if j == 0 && v == nil {
  5977. v = make([]float64, 0)
  5978. changed = true
  5979. }
  5980. }
  5981. slh.End()
  5982. d.depthDecr()
  5983. return v, changed
  5984. }
  5985. func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) {
  5986. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  5987. vp := rv2i(rv).(*[]uint)
  5988. v, changed := fastpathTV.DecSliceUintV(*vp, !array, d)
  5989. if changed {
  5990. *vp = v
  5991. }
  5992. } else {
  5993. v := rv2i(rv).([]uint)
  5994. v2, changed := fastpathTV.DecSliceUintV(v, !array, d)
  5995. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  5996. copy(v, v2)
  5997. }
  5998. }
  5999. }
  6000. func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) {
  6001. v, changed := f.DecSliceUintV(*vp, true, d)
  6002. if changed {
  6003. *vp = v
  6004. }
  6005. }
  6006. func (_ fastpathT) DecSliceUintV(v []uint, canChange bool, d *Decoder) (_ []uint, changed bool) {
  6007. dd := d.d
  6008. slh, containerLenS := d.decSliceHelperStart()
  6009. if containerLenS == 0 {
  6010. if canChange {
  6011. if v == nil {
  6012. v = []uint{}
  6013. } else if len(v) != 0 {
  6014. v = v[:0]
  6015. }
  6016. changed = true
  6017. }
  6018. slh.End()
  6019. return v, changed
  6020. }
  6021. d.depthIncr()
  6022. hasLen := containerLenS > 0
  6023. var xlen int
  6024. if hasLen && canChange {
  6025. if containerLenS > cap(v) {
  6026. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6027. if xlen <= cap(v) {
  6028. v = v[:uint(xlen)]
  6029. } else {
  6030. v = make([]uint, uint(xlen))
  6031. }
  6032. changed = true
  6033. } else if containerLenS != len(v) {
  6034. v = v[:containerLenS]
  6035. changed = true
  6036. }
  6037. }
  6038. var j int
  6039. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6040. if j == 0 && len(v) == 0 && canChange {
  6041. if hasLen {
  6042. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6043. } else {
  6044. xlen = 8
  6045. }
  6046. v = make([]uint, uint(xlen))
  6047. changed = true
  6048. }
  6049. // if indefinite, etc, then expand the slice if necessary
  6050. var decodeIntoBlank bool
  6051. if j >= len(v) {
  6052. if canChange {
  6053. v = append(v, 0)
  6054. changed = true
  6055. } else {
  6056. d.arrayCannotExpand(len(v), j+1)
  6057. decodeIntoBlank = true
  6058. }
  6059. }
  6060. slh.ElemContainerState(j)
  6061. if decodeIntoBlank {
  6062. d.swallow()
  6063. } else if dd.TryDecodeAsNil() {
  6064. v[uint(j)] = 0
  6065. } else {
  6066. v[uint(j)] = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  6067. }
  6068. }
  6069. if canChange {
  6070. if j < len(v) {
  6071. v = v[:uint(j)]
  6072. changed = true
  6073. } else if j == 0 && v == nil {
  6074. v = make([]uint, 0)
  6075. changed = true
  6076. }
  6077. }
  6078. slh.End()
  6079. d.depthDecr()
  6080. return v, changed
  6081. }
  6082. func (d *Decoder) fastpathDecSliceUint8R(f *codecFnInfo, rv reflect.Value) {
  6083. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6084. vp := rv2i(rv).(*[]uint8)
  6085. v, changed := fastpathTV.DecSliceUint8V(*vp, !array, d)
  6086. if changed {
  6087. *vp = v
  6088. }
  6089. } else {
  6090. v := rv2i(rv).([]uint8)
  6091. v2, changed := fastpathTV.DecSliceUint8V(v, !array, d)
  6092. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6093. copy(v, v2)
  6094. }
  6095. }
  6096. }
  6097. func (f fastpathT) DecSliceUint8X(vp *[]uint8, d *Decoder) {
  6098. v, changed := f.DecSliceUint8V(*vp, true, d)
  6099. if changed {
  6100. *vp = v
  6101. }
  6102. }
  6103. func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) {
  6104. dd := d.d
  6105. slh, containerLenS := d.decSliceHelperStart()
  6106. if containerLenS == 0 {
  6107. if canChange {
  6108. if v == nil {
  6109. v = []uint8{}
  6110. } else if len(v) != 0 {
  6111. v = v[:0]
  6112. }
  6113. changed = true
  6114. }
  6115. slh.End()
  6116. return v, changed
  6117. }
  6118. d.depthIncr()
  6119. hasLen := containerLenS > 0
  6120. var xlen int
  6121. if hasLen && canChange {
  6122. if containerLenS > cap(v) {
  6123. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6124. if xlen <= cap(v) {
  6125. v = v[:uint(xlen)]
  6126. } else {
  6127. v = make([]uint8, uint(xlen))
  6128. }
  6129. changed = true
  6130. } else if containerLenS != len(v) {
  6131. v = v[:containerLenS]
  6132. changed = true
  6133. }
  6134. }
  6135. var j int
  6136. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6137. if j == 0 && len(v) == 0 && canChange {
  6138. if hasLen {
  6139. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6140. } else {
  6141. xlen = 8
  6142. }
  6143. v = make([]uint8, uint(xlen))
  6144. changed = true
  6145. }
  6146. // if indefinite, etc, then expand the slice if necessary
  6147. var decodeIntoBlank bool
  6148. if j >= len(v) {
  6149. if canChange {
  6150. v = append(v, 0)
  6151. changed = true
  6152. } else {
  6153. d.arrayCannotExpand(len(v), j+1)
  6154. decodeIntoBlank = true
  6155. }
  6156. }
  6157. slh.ElemContainerState(j)
  6158. if decodeIntoBlank {
  6159. d.swallow()
  6160. } else if dd.TryDecodeAsNil() {
  6161. v[uint(j)] = 0
  6162. } else {
  6163. v[uint(j)] = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  6164. }
  6165. }
  6166. if canChange {
  6167. if j < len(v) {
  6168. v = v[:uint(j)]
  6169. changed = true
  6170. } else if j == 0 && v == nil {
  6171. v = make([]uint8, 0)
  6172. changed = true
  6173. }
  6174. }
  6175. slh.End()
  6176. d.depthDecr()
  6177. return v, changed
  6178. }
  6179. func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  6180. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6181. vp := rv2i(rv).(*[]uint16)
  6182. v, changed := fastpathTV.DecSliceUint16V(*vp, !array, d)
  6183. if changed {
  6184. *vp = v
  6185. }
  6186. } else {
  6187. v := rv2i(rv).([]uint16)
  6188. v2, changed := fastpathTV.DecSliceUint16V(v, !array, d)
  6189. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6190. copy(v, v2)
  6191. }
  6192. }
  6193. }
  6194. func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) {
  6195. v, changed := f.DecSliceUint16V(*vp, true, d)
  6196. if changed {
  6197. *vp = v
  6198. }
  6199. }
  6200. func (_ fastpathT) DecSliceUint16V(v []uint16, canChange bool, d *Decoder) (_ []uint16, changed bool) {
  6201. dd := d.d
  6202. slh, containerLenS := d.decSliceHelperStart()
  6203. if containerLenS == 0 {
  6204. if canChange {
  6205. if v == nil {
  6206. v = []uint16{}
  6207. } else if len(v) != 0 {
  6208. v = v[:0]
  6209. }
  6210. changed = true
  6211. }
  6212. slh.End()
  6213. return v, changed
  6214. }
  6215. d.depthIncr()
  6216. hasLen := containerLenS > 0
  6217. var xlen int
  6218. if hasLen && canChange {
  6219. if containerLenS > cap(v) {
  6220. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6221. if xlen <= cap(v) {
  6222. v = v[:uint(xlen)]
  6223. } else {
  6224. v = make([]uint16, uint(xlen))
  6225. }
  6226. changed = true
  6227. } else if containerLenS != len(v) {
  6228. v = v[:containerLenS]
  6229. changed = true
  6230. }
  6231. }
  6232. var j int
  6233. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6234. if j == 0 && len(v) == 0 && canChange {
  6235. if hasLen {
  6236. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6237. } else {
  6238. xlen = 8
  6239. }
  6240. v = make([]uint16, uint(xlen))
  6241. changed = true
  6242. }
  6243. // if indefinite, etc, then expand the slice if necessary
  6244. var decodeIntoBlank bool
  6245. if j >= len(v) {
  6246. if canChange {
  6247. v = append(v, 0)
  6248. changed = true
  6249. } else {
  6250. d.arrayCannotExpand(len(v), j+1)
  6251. decodeIntoBlank = true
  6252. }
  6253. }
  6254. slh.ElemContainerState(j)
  6255. if decodeIntoBlank {
  6256. d.swallow()
  6257. } else if dd.TryDecodeAsNil() {
  6258. v[uint(j)] = 0
  6259. } else {
  6260. v[uint(j)] = uint16(chkOvf.UintV(dd.DecodeUint64(), 16))
  6261. }
  6262. }
  6263. if canChange {
  6264. if j < len(v) {
  6265. v = v[:uint(j)]
  6266. changed = true
  6267. } else if j == 0 && v == nil {
  6268. v = make([]uint16, 0)
  6269. changed = true
  6270. }
  6271. }
  6272. slh.End()
  6273. d.depthDecr()
  6274. return v, changed
  6275. }
  6276. func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  6277. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6278. vp := rv2i(rv).(*[]uint32)
  6279. v, changed := fastpathTV.DecSliceUint32V(*vp, !array, d)
  6280. if changed {
  6281. *vp = v
  6282. }
  6283. } else {
  6284. v := rv2i(rv).([]uint32)
  6285. v2, changed := fastpathTV.DecSliceUint32V(v, !array, d)
  6286. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6287. copy(v, v2)
  6288. }
  6289. }
  6290. }
  6291. func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) {
  6292. v, changed := f.DecSliceUint32V(*vp, true, d)
  6293. if changed {
  6294. *vp = v
  6295. }
  6296. }
  6297. func (_ fastpathT) DecSliceUint32V(v []uint32, canChange bool, d *Decoder) (_ []uint32, changed bool) {
  6298. dd := d.d
  6299. slh, containerLenS := d.decSliceHelperStart()
  6300. if containerLenS == 0 {
  6301. if canChange {
  6302. if v == nil {
  6303. v = []uint32{}
  6304. } else if len(v) != 0 {
  6305. v = v[:0]
  6306. }
  6307. changed = true
  6308. }
  6309. slh.End()
  6310. return v, changed
  6311. }
  6312. d.depthIncr()
  6313. hasLen := containerLenS > 0
  6314. var xlen int
  6315. if hasLen && canChange {
  6316. if containerLenS > cap(v) {
  6317. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6318. if xlen <= cap(v) {
  6319. v = v[:uint(xlen)]
  6320. } else {
  6321. v = make([]uint32, uint(xlen))
  6322. }
  6323. changed = true
  6324. } else if containerLenS != len(v) {
  6325. v = v[:containerLenS]
  6326. changed = true
  6327. }
  6328. }
  6329. var j int
  6330. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6331. if j == 0 && len(v) == 0 && canChange {
  6332. if hasLen {
  6333. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6334. } else {
  6335. xlen = 8
  6336. }
  6337. v = make([]uint32, uint(xlen))
  6338. changed = true
  6339. }
  6340. // if indefinite, etc, then expand the slice if necessary
  6341. var decodeIntoBlank bool
  6342. if j >= len(v) {
  6343. if canChange {
  6344. v = append(v, 0)
  6345. changed = true
  6346. } else {
  6347. d.arrayCannotExpand(len(v), j+1)
  6348. decodeIntoBlank = true
  6349. }
  6350. }
  6351. slh.ElemContainerState(j)
  6352. if decodeIntoBlank {
  6353. d.swallow()
  6354. } else if dd.TryDecodeAsNil() {
  6355. v[uint(j)] = 0
  6356. } else {
  6357. v[uint(j)] = uint32(chkOvf.UintV(dd.DecodeUint64(), 32))
  6358. }
  6359. }
  6360. if canChange {
  6361. if j < len(v) {
  6362. v = v[:uint(j)]
  6363. changed = true
  6364. } else if j == 0 && v == nil {
  6365. v = make([]uint32, 0)
  6366. changed = true
  6367. }
  6368. }
  6369. slh.End()
  6370. d.depthDecr()
  6371. return v, changed
  6372. }
  6373. func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  6374. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6375. vp := rv2i(rv).(*[]uint64)
  6376. v, changed := fastpathTV.DecSliceUint64V(*vp, !array, d)
  6377. if changed {
  6378. *vp = v
  6379. }
  6380. } else {
  6381. v := rv2i(rv).([]uint64)
  6382. v2, changed := fastpathTV.DecSliceUint64V(v, !array, d)
  6383. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6384. copy(v, v2)
  6385. }
  6386. }
  6387. }
  6388. func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) {
  6389. v, changed := f.DecSliceUint64V(*vp, true, d)
  6390. if changed {
  6391. *vp = v
  6392. }
  6393. }
  6394. func (_ fastpathT) DecSliceUint64V(v []uint64, canChange bool, d *Decoder) (_ []uint64, changed bool) {
  6395. dd := d.d
  6396. slh, containerLenS := d.decSliceHelperStart()
  6397. if containerLenS == 0 {
  6398. if canChange {
  6399. if v == nil {
  6400. v = []uint64{}
  6401. } else if len(v) != 0 {
  6402. v = v[:0]
  6403. }
  6404. changed = true
  6405. }
  6406. slh.End()
  6407. return v, changed
  6408. }
  6409. d.depthIncr()
  6410. hasLen := containerLenS > 0
  6411. var xlen int
  6412. if hasLen && canChange {
  6413. if containerLenS > cap(v) {
  6414. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6415. if xlen <= cap(v) {
  6416. v = v[:uint(xlen)]
  6417. } else {
  6418. v = make([]uint64, uint(xlen))
  6419. }
  6420. changed = true
  6421. } else if containerLenS != len(v) {
  6422. v = v[:containerLenS]
  6423. changed = true
  6424. }
  6425. }
  6426. var j int
  6427. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6428. if j == 0 && len(v) == 0 && canChange {
  6429. if hasLen {
  6430. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6431. } else {
  6432. xlen = 8
  6433. }
  6434. v = make([]uint64, uint(xlen))
  6435. changed = true
  6436. }
  6437. // if indefinite, etc, then expand the slice if necessary
  6438. var decodeIntoBlank bool
  6439. if j >= len(v) {
  6440. if canChange {
  6441. v = append(v, 0)
  6442. changed = true
  6443. } else {
  6444. d.arrayCannotExpand(len(v), j+1)
  6445. decodeIntoBlank = true
  6446. }
  6447. }
  6448. slh.ElemContainerState(j)
  6449. if decodeIntoBlank {
  6450. d.swallow()
  6451. } else if dd.TryDecodeAsNil() {
  6452. v[uint(j)] = 0
  6453. } else {
  6454. v[uint(j)] = dd.DecodeUint64()
  6455. }
  6456. }
  6457. if canChange {
  6458. if j < len(v) {
  6459. v = v[:uint(j)]
  6460. changed = true
  6461. } else if j == 0 && v == nil {
  6462. v = make([]uint64, 0)
  6463. changed = true
  6464. }
  6465. }
  6466. slh.End()
  6467. d.depthDecr()
  6468. return v, changed
  6469. }
  6470. func (d *Decoder) fastpathDecSliceUintptrR(f *codecFnInfo, rv reflect.Value) {
  6471. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6472. vp := rv2i(rv).(*[]uintptr)
  6473. v, changed := fastpathTV.DecSliceUintptrV(*vp, !array, d)
  6474. if changed {
  6475. *vp = v
  6476. }
  6477. } else {
  6478. v := rv2i(rv).([]uintptr)
  6479. v2, changed := fastpathTV.DecSliceUintptrV(v, !array, d)
  6480. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6481. copy(v, v2)
  6482. }
  6483. }
  6484. }
  6485. func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, d *Decoder) {
  6486. v, changed := f.DecSliceUintptrV(*vp, true, d)
  6487. if changed {
  6488. *vp = v
  6489. }
  6490. }
  6491. func (_ fastpathT) DecSliceUintptrV(v []uintptr, canChange bool, d *Decoder) (_ []uintptr, changed bool) {
  6492. dd := d.d
  6493. slh, containerLenS := d.decSliceHelperStart()
  6494. if containerLenS == 0 {
  6495. if canChange {
  6496. if v == nil {
  6497. v = []uintptr{}
  6498. } else if len(v) != 0 {
  6499. v = v[:0]
  6500. }
  6501. changed = true
  6502. }
  6503. slh.End()
  6504. return v, changed
  6505. }
  6506. d.depthIncr()
  6507. hasLen := containerLenS > 0
  6508. var xlen int
  6509. if hasLen && canChange {
  6510. if containerLenS > cap(v) {
  6511. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6512. if xlen <= cap(v) {
  6513. v = v[:uint(xlen)]
  6514. } else {
  6515. v = make([]uintptr, uint(xlen))
  6516. }
  6517. changed = true
  6518. } else if containerLenS != len(v) {
  6519. v = v[:containerLenS]
  6520. changed = true
  6521. }
  6522. }
  6523. var j int
  6524. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6525. if j == 0 && len(v) == 0 && canChange {
  6526. if hasLen {
  6527. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6528. } else {
  6529. xlen = 8
  6530. }
  6531. v = make([]uintptr, uint(xlen))
  6532. changed = true
  6533. }
  6534. // if indefinite, etc, then expand the slice if necessary
  6535. var decodeIntoBlank bool
  6536. if j >= len(v) {
  6537. if canChange {
  6538. v = append(v, 0)
  6539. changed = true
  6540. } else {
  6541. d.arrayCannotExpand(len(v), j+1)
  6542. decodeIntoBlank = true
  6543. }
  6544. }
  6545. slh.ElemContainerState(j)
  6546. if decodeIntoBlank {
  6547. d.swallow()
  6548. } else if dd.TryDecodeAsNil() {
  6549. v[uint(j)] = 0
  6550. } else {
  6551. v[uint(j)] = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  6552. }
  6553. }
  6554. if canChange {
  6555. if j < len(v) {
  6556. v = v[:uint(j)]
  6557. changed = true
  6558. } else if j == 0 && v == nil {
  6559. v = make([]uintptr, 0)
  6560. changed = true
  6561. }
  6562. }
  6563. slh.End()
  6564. d.depthDecr()
  6565. return v, changed
  6566. }
  6567. func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) {
  6568. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6569. vp := rv2i(rv).(*[]int)
  6570. v, changed := fastpathTV.DecSliceIntV(*vp, !array, d)
  6571. if changed {
  6572. *vp = v
  6573. }
  6574. } else {
  6575. v := rv2i(rv).([]int)
  6576. v2, changed := fastpathTV.DecSliceIntV(v, !array, d)
  6577. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6578. copy(v, v2)
  6579. }
  6580. }
  6581. }
  6582. func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) {
  6583. v, changed := f.DecSliceIntV(*vp, true, d)
  6584. if changed {
  6585. *vp = v
  6586. }
  6587. }
  6588. func (_ fastpathT) DecSliceIntV(v []int, canChange bool, d *Decoder) (_ []int, changed bool) {
  6589. dd := d.d
  6590. slh, containerLenS := d.decSliceHelperStart()
  6591. if containerLenS == 0 {
  6592. if canChange {
  6593. if v == nil {
  6594. v = []int{}
  6595. } else if len(v) != 0 {
  6596. v = v[:0]
  6597. }
  6598. changed = true
  6599. }
  6600. slh.End()
  6601. return v, changed
  6602. }
  6603. d.depthIncr()
  6604. hasLen := containerLenS > 0
  6605. var xlen int
  6606. if hasLen && canChange {
  6607. if containerLenS > cap(v) {
  6608. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6609. if xlen <= cap(v) {
  6610. v = v[:uint(xlen)]
  6611. } else {
  6612. v = make([]int, uint(xlen))
  6613. }
  6614. changed = true
  6615. } else if containerLenS != len(v) {
  6616. v = v[:containerLenS]
  6617. changed = true
  6618. }
  6619. }
  6620. var j int
  6621. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6622. if j == 0 && len(v) == 0 && canChange {
  6623. if hasLen {
  6624. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6625. } else {
  6626. xlen = 8
  6627. }
  6628. v = make([]int, uint(xlen))
  6629. changed = true
  6630. }
  6631. // if indefinite, etc, then expand the slice if necessary
  6632. var decodeIntoBlank bool
  6633. if j >= len(v) {
  6634. if canChange {
  6635. v = append(v, 0)
  6636. changed = true
  6637. } else {
  6638. d.arrayCannotExpand(len(v), j+1)
  6639. decodeIntoBlank = true
  6640. }
  6641. }
  6642. slh.ElemContainerState(j)
  6643. if decodeIntoBlank {
  6644. d.swallow()
  6645. } else if dd.TryDecodeAsNil() {
  6646. v[uint(j)] = 0
  6647. } else {
  6648. v[uint(j)] = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  6649. }
  6650. }
  6651. if canChange {
  6652. if j < len(v) {
  6653. v = v[:uint(j)]
  6654. changed = true
  6655. } else if j == 0 && v == nil {
  6656. v = make([]int, 0)
  6657. changed = true
  6658. }
  6659. }
  6660. slh.End()
  6661. d.depthDecr()
  6662. return v, changed
  6663. }
  6664. func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  6665. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6666. vp := rv2i(rv).(*[]int8)
  6667. v, changed := fastpathTV.DecSliceInt8V(*vp, !array, d)
  6668. if changed {
  6669. *vp = v
  6670. }
  6671. } else {
  6672. v := rv2i(rv).([]int8)
  6673. v2, changed := fastpathTV.DecSliceInt8V(v, !array, d)
  6674. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6675. copy(v, v2)
  6676. }
  6677. }
  6678. }
  6679. func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) {
  6680. v, changed := f.DecSliceInt8V(*vp, true, d)
  6681. if changed {
  6682. *vp = v
  6683. }
  6684. }
  6685. func (_ fastpathT) DecSliceInt8V(v []int8, canChange bool, d *Decoder) (_ []int8, changed bool) {
  6686. dd := d.d
  6687. slh, containerLenS := d.decSliceHelperStart()
  6688. if containerLenS == 0 {
  6689. if canChange {
  6690. if v == nil {
  6691. v = []int8{}
  6692. } else if len(v) != 0 {
  6693. v = v[:0]
  6694. }
  6695. changed = true
  6696. }
  6697. slh.End()
  6698. return v, changed
  6699. }
  6700. d.depthIncr()
  6701. hasLen := containerLenS > 0
  6702. var xlen int
  6703. if hasLen && canChange {
  6704. if containerLenS > cap(v) {
  6705. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6706. if xlen <= cap(v) {
  6707. v = v[:uint(xlen)]
  6708. } else {
  6709. v = make([]int8, uint(xlen))
  6710. }
  6711. changed = true
  6712. } else if containerLenS != len(v) {
  6713. v = v[:containerLenS]
  6714. changed = true
  6715. }
  6716. }
  6717. var j int
  6718. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6719. if j == 0 && len(v) == 0 && canChange {
  6720. if hasLen {
  6721. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  6722. } else {
  6723. xlen = 8
  6724. }
  6725. v = make([]int8, uint(xlen))
  6726. changed = true
  6727. }
  6728. // if indefinite, etc, then expand the slice if necessary
  6729. var decodeIntoBlank bool
  6730. if j >= len(v) {
  6731. if canChange {
  6732. v = append(v, 0)
  6733. changed = true
  6734. } else {
  6735. d.arrayCannotExpand(len(v), j+1)
  6736. decodeIntoBlank = true
  6737. }
  6738. }
  6739. slh.ElemContainerState(j)
  6740. if decodeIntoBlank {
  6741. d.swallow()
  6742. } else if dd.TryDecodeAsNil() {
  6743. v[uint(j)] = 0
  6744. } else {
  6745. v[uint(j)] = int8(chkOvf.IntV(dd.DecodeInt64(), 8))
  6746. }
  6747. }
  6748. if canChange {
  6749. if j < len(v) {
  6750. v = v[:uint(j)]
  6751. changed = true
  6752. } else if j == 0 && v == nil {
  6753. v = make([]int8, 0)
  6754. changed = true
  6755. }
  6756. }
  6757. slh.End()
  6758. d.depthDecr()
  6759. return v, changed
  6760. }
  6761. func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  6762. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6763. vp := rv2i(rv).(*[]int16)
  6764. v, changed := fastpathTV.DecSliceInt16V(*vp, !array, d)
  6765. if changed {
  6766. *vp = v
  6767. }
  6768. } else {
  6769. v := rv2i(rv).([]int16)
  6770. v2, changed := fastpathTV.DecSliceInt16V(v, !array, d)
  6771. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6772. copy(v, v2)
  6773. }
  6774. }
  6775. }
  6776. func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) {
  6777. v, changed := f.DecSliceInt16V(*vp, true, d)
  6778. if changed {
  6779. *vp = v
  6780. }
  6781. }
  6782. func (_ fastpathT) DecSliceInt16V(v []int16, canChange bool, d *Decoder) (_ []int16, changed bool) {
  6783. dd := d.d
  6784. slh, containerLenS := d.decSliceHelperStart()
  6785. if containerLenS == 0 {
  6786. if canChange {
  6787. if v == nil {
  6788. v = []int16{}
  6789. } else if len(v) != 0 {
  6790. v = v[:0]
  6791. }
  6792. changed = true
  6793. }
  6794. slh.End()
  6795. return v, changed
  6796. }
  6797. d.depthIncr()
  6798. hasLen := containerLenS > 0
  6799. var xlen int
  6800. if hasLen && canChange {
  6801. if containerLenS > cap(v) {
  6802. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6803. if xlen <= cap(v) {
  6804. v = v[:uint(xlen)]
  6805. } else {
  6806. v = make([]int16, uint(xlen))
  6807. }
  6808. changed = true
  6809. } else if containerLenS != len(v) {
  6810. v = v[:containerLenS]
  6811. changed = true
  6812. }
  6813. }
  6814. var j int
  6815. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6816. if j == 0 && len(v) == 0 && canChange {
  6817. if hasLen {
  6818. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  6819. } else {
  6820. xlen = 8
  6821. }
  6822. v = make([]int16, uint(xlen))
  6823. changed = true
  6824. }
  6825. // if indefinite, etc, then expand the slice if necessary
  6826. var decodeIntoBlank bool
  6827. if j >= len(v) {
  6828. if canChange {
  6829. v = append(v, 0)
  6830. changed = true
  6831. } else {
  6832. d.arrayCannotExpand(len(v), j+1)
  6833. decodeIntoBlank = true
  6834. }
  6835. }
  6836. slh.ElemContainerState(j)
  6837. if decodeIntoBlank {
  6838. d.swallow()
  6839. } else if dd.TryDecodeAsNil() {
  6840. v[uint(j)] = 0
  6841. } else {
  6842. v[uint(j)] = int16(chkOvf.IntV(dd.DecodeInt64(), 16))
  6843. }
  6844. }
  6845. if canChange {
  6846. if j < len(v) {
  6847. v = v[:uint(j)]
  6848. changed = true
  6849. } else if j == 0 && v == nil {
  6850. v = make([]int16, 0)
  6851. changed = true
  6852. }
  6853. }
  6854. slh.End()
  6855. d.depthDecr()
  6856. return v, changed
  6857. }
  6858. func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  6859. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6860. vp := rv2i(rv).(*[]int32)
  6861. v, changed := fastpathTV.DecSliceInt32V(*vp, !array, d)
  6862. if changed {
  6863. *vp = v
  6864. }
  6865. } else {
  6866. v := rv2i(rv).([]int32)
  6867. v2, changed := fastpathTV.DecSliceInt32V(v, !array, d)
  6868. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6869. copy(v, v2)
  6870. }
  6871. }
  6872. }
  6873. func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) {
  6874. v, changed := f.DecSliceInt32V(*vp, true, d)
  6875. if changed {
  6876. *vp = v
  6877. }
  6878. }
  6879. func (_ fastpathT) DecSliceInt32V(v []int32, canChange bool, d *Decoder) (_ []int32, changed bool) {
  6880. dd := d.d
  6881. slh, containerLenS := d.decSliceHelperStart()
  6882. if containerLenS == 0 {
  6883. if canChange {
  6884. if v == nil {
  6885. v = []int32{}
  6886. } else if len(v) != 0 {
  6887. v = v[:0]
  6888. }
  6889. changed = true
  6890. }
  6891. slh.End()
  6892. return v, changed
  6893. }
  6894. d.depthIncr()
  6895. hasLen := containerLenS > 0
  6896. var xlen int
  6897. if hasLen && canChange {
  6898. if containerLenS > cap(v) {
  6899. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6900. if xlen <= cap(v) {
  6901. v = v[:uint(xlen)]
  6902. } else {
  6903. v = make([]int32, uint(xlen))
  6904. }
  6905. changed = true
  6906. } else if containerLenS != len(v) {
  6907. v = v[:containerLenS]
  6908. changed = true
  6909. }
  6910. }
  6911. var j int
  6912. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  6913. if j == 0 && len(v) == 0 && canChange {
  6914. if hasLen {
  6915. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  6916. } else {
  6917. xlen = 8
  6918. }
  6919. v = make([]int32, uint(xlen))
  6920. changed = true
  6921. }
  6922. // if indefinite, etc, then expand the slice if necessary
  6923. var decodeIntoBlank bool
  6924. if j >= len(v) {
  6925. if canChange {
  6926. v = append(v, 0)
  6927. changed = true
  6928. } else {
  6929. d.arrayCannotExpand(len(v), j+1)
  6930. decodeIntoBlank = true
  6931. }
  6932. }
  6933. slh.ElemContainerState(j)
  6934. if decodeIntoBlank {
  6935. d.swallow()
  6936. } else if dd.TryDecodeAsNil() {
  6937. v[uint(j)] = 0
  6938. } else {
  6939. v[uint(j)] = int32(chkOvf.IntV(dd.DecodeInt64(), 32))
  6940. }
  6941. }
  6942. if canChange {
  6943. if j < len(v) {
  6944. v = v[:uint(j)]
  6945. changed = true
  6946. } else if j == 0 && v == nil {
  6947. v = make([]int32, 0)
  6948. changed = true
  6949. }
  6950. }
  6951. slh.End()
  6952. d.depthDecr()
  6953. return v, changed
  6954. }
  6955. func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  6956. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  6957. vp := rv2i(rv).(*[]int64)
  6958. v, changed := fastpathTV.DecSliceInt64V(*vp, !array, d)
  6959. if changed {
  6960. *vp = v
  6961. }
  6962. } else {
  6963. v := rv2i(rv).([]int64)
  6964. v2, changed := fastpathTV.DecSliceInt64V(v, !array, d)
  6965. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  6966. copy(v, v2)
  6967. }
  6968. }
  6969. }
  6970. func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) {
  6971. v, changed := f.DecSliceInt64V(*vp, true, d)
  6972. if changed {
  6973. *vp = v
  6974. }
  6975. }
  6976. func (_ fastpathT) DecSliceInt64V(v []int64, canChange bool, d *Decoder) (_ []int64, changed bool) {
  6977. dd := d.d
  6978. slh, containerLenS := d.decSliceHelperStart()
  6979. if containerLenS == 0 {
  6980. if canChange {
  6981. if v == nil {
  6982. v = []int64{}
  6983. } else if len(v) != 0 {
  6984. v = v[:0]
  6985. }
  6986. changed = true
  6987. }
  6988. slh.End()
  6989. return v, changed
  6990. }
  6991. d.depthIncr()
  6992. hasLen := containerLenS > 0
  6993. var xlen int
  6994. if hasLen && canChange {
  6995. if containerLenS > cap(v) {
  6996. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  6997. if xlen <= cap(v) {
  6998. v = v[:uint(xlen)]
  6999. } else {
  7000. v = make([]int64, uint(xlen))
  7001. }
  7002. changed = true
  7003. } else if containerLenS != len(v) {
  7004. v = v[:containerLenS]
  7005. changed = true
  7006. }
  7007. }
  7008. var j int
  7009. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  7010. if j == 0 && len(v) == 0 && canChange {
  7011. if hasLen {
  7012. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  7013. } else {
  7014. xlen = 8
  7015. }
  7016. v = make([]int64, uint(xlen))
  7017. changed = true
  7018. }
  7019. // if indefinite, etc, then expand the slice if necessary
  7020. var decodeIntoBlank bool
  7021. if j >= len(v) {
  7022. if canChange {
  7023. v = append(v, 0)
  7024. changed = true
  7025. } else {
  7026. d.arrayCannotExpand(len(v), j+1)
  7027. decodeIntoBlank = true
  7028. }
  7029. }
  7030. slh.ElemContainerState(j)
  7031. if decodeIntoBlank {
  7032. d.swallow()
  7033. } else if dd.TryDecodeAsNil() {
  7034. v[uint(j)] = 0
  7035. } else {
  7036. v[uint(j)] = dd.DecodeInt64()
  7037. }
  7038. }
  7039. if canChange {
  7040. if j < len(v) {
  7041. v = v[:uint(j)]
  7042. changed = true
  7043. } else if j == 0 && v == nil {
  7044. v = make([]int64, 0)
  7045. changed = true
  7046. }
  7047. }
  7048. slh.End()
  7049. d.depthDecr()
  7050. return v, changed
  7051. }
  7052. func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  7053. if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr {
  7054. vp := rv2i(rv).(*[]bool)
  7055. v, changed := fastpathTV.DecSliceBoolV(*vp, !array, d)
  7056. if changed {
  7057. *vp = v
  7058. }
  7059. } else {
  7060. v := rv2i(rv).([]bool)
  7061. v2, changed := fastpathTV.DecSliceBoolV(v, !array, d)
  7062. if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) {
  7063. copy(v, v2)
  7064. }
  7065. }
  7066. }
  7067. func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) {
  7068. v, changed := f.DecSliceBoolV(*vp, true, d)
  7069. if changed {
  7070. *vp = v
  7071. }
  7072. }
  7073. func (_ fastpathT) DecSliceBoolV(v []bool, canChange bool, d *Decoder) (_ []bool, changed bool) {
  7074. dd := d.d
  7075. slh, containerLenS := d.decSliceHelperStart()
  7076. if containerLenS == 0 {
  7077. if canChange {
  7078. if v == nil {
  7079. v = []bool{}
  7080. } else if len(v) != 0 {
  7081. v = v[:0]
  7082. }
  7083. changed = true
  7084. }
  7085. slh.End()
  7086. return v, changed
  7087. }
  7088. d.depthIncr()
  7089. hasLen := containerLenS > 0
  7090. var xlen int
  7091. if hasLen && canChange {
  7092. if containerLenS > cap(v) {
  7093. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  7094. if xlen <= cap(v) {
  7095. v = v[:uint(xlen)]
  7096. } else {
  7097. v = make([]bool, uint(xlen))
  7098. }
  7099. changed = true
  7100. } else if containerLenS != len(v) {
  7101. v = v[:containerLenS]
  7102. changed = true
  7103. }
  7104. }
  7105. var j int
  7106. for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ {
  7107. if j == 0 && len(v) == 0 && canChange {
  7108. if hasLen {
  7109. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  7110. } else {
  7111. xlen = 8
  7112. }
  7113. v = make([]bool, uint(xlen))
  7114. changed = true
  7115. }
  7116. // if indefinite, etc, then expand the slice if necessary
  7117. var decodeIntoBlank bool
  7118. if j >= len(v) {
  7119. if canChange {
  7120. v = append(v, false)
  7121. changed = true
  7122. } else {
  7123. d.arrayCannotExpand(len(v), j+1)
  7124. decodeIntoBlank = true
  7125. }
  7126. }
  7127. slh.ElemContainerState(j)
  7128. if decodeIntoBlank {
  7129. d.swallow()
  7130. } else if dd.TryDecodeAsNil() {
  7131. v[uint(j)] = false
  7132. } else {
  7133. v[uint(j)] = dd.DecodeBool()
  7134. }
  7135. }
  7136. if canChange {
  7137. if j < len(v) {
  7138. v = v[:uint(j)]
  7139. changed = true
  7140. } else if j == 0 && v == nil {
  7141. v = make([]bool, 0)
  7142. changed = true
  7143. }
  7144. }
  7145. slh.End()
  7146. d.depthDecr()
  7147. return v, changed
  7148. }
  7149. func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  7150. if rv.Kind() == reflect.Ptr {
  7151. vp := rv2i(rv).(*map[string]interface{})
  7152. v, changed := fastpathTV.DecMapStringIntfV(*vp, true, d)
  7153. if changed {
  7154. *vp = v
  7155. }
  7156. } else {
  7157. fastpathTV.DecMapStringIntfV(rv2i(rv).(map[string]interface{}), false, d)
  7158. }
  7159. }
  7160. func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
  7161. v, changed := f.DecMapStringIntfV(*vp, true, d)
  7162. if changed {
  7163. *vp = v
  7164. }
  7165. }
  7166. func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, canChange bool,
  7167. d *Decoder) (_ map[string]interface{}, changed bool) {
  7168. dd, esep := d.d, d.hh.hasElemSeparators()
  7169. containerLen := dd.ReadMapStart()
  7170. if canChange && v == nil {
  7171. xlen := decInferLen(containerLen, d.h.MaxInitLen, 32)
  7172. v = make(map[string]interface{}, xlen)
  7173. changed = true
  7174. }
  7175. if containerLen == 0 {
  7176. dd.ReadMapEnd()
  7177. return v, changed
  7178. }
  7179. d.depthIncr()
  7180. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7181. var mk string
  7182. var mv interface{}
  7183. hasLen := containerLen > 0
  7184. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7185. if esep {
  7186. dd.ReadMapElemKey()
  7187. }
  7188. mk = dd.DecodeString()
  7189. if esep {
  7190. dd.ReadMapElemValue()
  7191. }
  7192. if dd.TryDecodeAsNil() {
  7193. if v == nil {
  7194. } else if d.h.DeleteOnNilMapValue {
  7195. delete(v, mk)
  7196. } else {
  7197. v[mk] = nil
  7198. }
  7199. continue
  7200. }
  7201. if mapGet {
  7202. mv = v[mk]
  7203. } else {
  7204. mv = nil
  7205. }
  7206. d.decode(&mv)
  7207. if v != nil {
  7208. v[mk] = mv
  7209. }
  7210. }
  7211. dd.ReadMapEnd()
  7212. d.depthDecr()
  7213. return v, changed
  7214. }
  7215. func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  7216. if rv.Kind() == reflect.Ptr {
  7217. vp := rv2i(rv).(*map[string]string)
  7218. v, changed := fastpathTV.DecMapStringStringV(*vp, true, d)
  7219. if changed {
  7220. *vp = v
  7221. }
  7222. } else {
  7223. fastpathTV.DecMapStringStringV(rv2i(rv).(map[string]string), false, d)
  7224. }
  7225. }
  7226. func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
  7227. v, changed := f.DecMapStringStringV(*vp, true, d)
  7228. if changed {
  7229. *vp = v
  7230. }
  7231. }
  7232. func (_ fastpathT) DecMapStringStringV(v map[string]string, canChange bool,
  7233. d *Decoder) (_ map[string]string, changed bool) {
  7234. dd, esep := d.d, d.hh.hasElemSeparators()
  7235. containerLen := dd.ReadMapStart()
  7236. if canChange && v == nil {
  7237. xlen := decInferLen(containerLen, d.h.MaxInitLen, 32)
  7238. v = make(map[string]string, xlen)
  7239. changed = true
  7240. }
  7241. if containerLen == 0 {
  7242. dd.ReadMapEnd()
  7243. return v, changed
  7244. }
  7245. d.depthIncr()
  7246. var mk string
  7247. var mv string
  7248. hasLen := containerLen > 0
  7249. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7250. if esep {
  7251. dd.ReadMapElemKey()
  7252. }
  7253. mk = dd.DecodeString()
  7254. if esep {
  7255. dd.ReadMapElemValue()
  7256. }
  7257. if dd.TryDecodeAsNil() {
  7258. if v == nil {
  7259. } else if d.h.DeleteOnNilMapValue {
  7260. delete(v, mk)
  7261. } else {
  7262. v[mk] = ""
  7263. }
  7264. continue
  7265. }
  7266. mv = dd.DecodeString()
  7267. if v != nil {
  7268. v[mk] = mv
  7269. }
  7270. }
  7271. dd.ReadMapEnd()
  7272. d.depthDecr()
  7273. return v, changed
  7274. }
  7275. func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  7276. if rv.Kind() == reflect.Ptr {
  7277. vp := rv2i(rv).(*map[string]uint)
  7278. v, changed := fastpathTV.DecMapStringUintV(*vp, true, d)
  7279. if changed {
  7280. *vp = v
  7281. }
  7282. } else {
  7283. fastpathTV.DecMapStringUintV(rv2i(rv).(map[string]uint), false, d)
  7284. }
  7285. }
  7286. func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) {
  7287. v, changed := f.DecMapStringUintV(*vp, true, d)
  7288. if changed {
  7289. *vp = v
  7290. }
  7291. }
  7292. func (_ fastpathT) DecMapStringUintV(v map[string]uint, canChange bool,
  7293. d *Decoder) (_ map[string]uint, changed bool) {
  7294. dd, esep := d.d, d.hh.hasElemSeparators()
  7295. containerLen := dd.ReadMapStart()
  7296. if canChange && v == nil {
  7297. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7298. v = make(map[string]uint, xlen)
  7299. changed = true
  7300. }
  7301. if containerLen == 0 {
  7302. dd.ReadMapEnd()
  7303. return v, changed
  7304. }
  7305. d.depthIncr()
  7306. var mk string
  7307. var mv uint
  7308. hasLen := containerLen > 0
  7309. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7310. if esep {
  7311. dd.ReadMapElemKey()
  7312. }
  7313. mk = dd.DecodeString()
  7314. if esep {
  7315. dd.ReadMapElemValue()
  7316. }
  7317. if dd.TryDecodeAsNil() {
  7318. if v == nil {
  7319. } else if d.h.DeleteOnNilMapValue {
  7320. delete(v, mk)
  7321. } else {
  7322. v[mk] = 0
  7323. }
  7324. continue
  7325. }
  7326. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7327. if v != nil {
  7328. v[mk] = mv
  7329. }
  7330. }
  7331. dd.ReadMapEnd()
  7332. d.depthDecr()
  7333. return v, changed
  7334. }
  7335. func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  7336. if rv.Kind() == reflect.Ptr {
  7337. vp := rv2i(rv).(*map[string]uint8)
  7338. v, changed := fastpathTV.DecMapStringUint8V(*vp, true, d)
  7339. if changed {
  7340. *vp = v
  7341. }
  7342. } else {
  7343. fastpathTV.DecMapStringUint8V(rv2i(rv).(map[string]uint8), false, d)
  7344. }
  7345. }
  7346. func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
  7347. v, changed := f.DecMapStringUint8V(*vp, true, d)
  7348. if changed {
  7349. *vp = v
  7350. }
  7351. }
  7352. func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, canChange bool,
  7353. d *Decoder) (_ map[string]uint8, changed bool) {
  7354. dd, esep := d.d, d.hh.hasElemSeparators()
  7355. containerLen := dd.ReadMapStart()
  7356. if canChange && v == nil {
  7357. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  7358. v = make(map[string]uint8, xlen)
  7359. changed = true
  7360. }
  7361. if containerLen == 0 {
  7362. dd.ReadMapEnd()
  7363. return v, changed
  7364. }
  7365. d.depthIncr()
  7366. var mk string
  7367. var mv uint8
  7368. hasLen := containerLen > 0
  7369. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7370. if esep {
  7371. dd.ReadMapElemKey()
  7372. }
  7373. mk = dd.DecodeString()
  7374. if esep {
  7375. dd.ReadMapElemValue()
  7376. }
  7377. if dd.TryDecodeAsNil() {
  7378. if v == nil {
  7379. } else if d.h.DeleteOnNilMapValue {
  7380. delete(v, mk)
  7381. } else {
  7382. v[mk] = 0
  7383. }
  7384. continue
  7385. }
  7386. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  7387. if v != nil {
  7388. v[mk] = mv
  7389. }
  7390. }
  7391. dd.ReadMapEnd()
  7392. d.depthDecr()
  7393. return v, changed
  7394. }
  7395. func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  7396. if rv.Kind() == reflect.Ptr {
  7397. vp := rv2i(rv).(*map[string]uint64)
  7398. v, changed := fastpathTV.DecMapStringUint64V(*vp, true, d)
  7399. if changed {
  7400. *vp = v
  7401. }
  7402. } else {
  7403. fastpathTV.DecMapStringUint64V(rv2i(rv).(map[string]uint64), false, d)
  7404. }
  7405. }
  7406. func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
  7407. v, changed := f.DecMapStringUint64V(*vp, true, d)
  7408. if changed {
  7409. *vp = v
  7410. }
  7411. }
  7412. func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, canChange bool,
  7413. d *Decoder) (_ map[string]uint64, changed bool) {
  7414. dd, esep := d.d, d.hh.hasElemSeparators()
  7415. containerLen := dd.ReadMapStart()
  7416. if canChange && v == nil {
  7417. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7418. v = make(map[string]uint64, xlen)
  7419. changed = true
  7420. }
  7421. if containerLen == 0 {
  7422. dd.ReadMapEnd()
  7423. return v, changed
  7424. }
  7425. d.depthIncr()
  7426. var mk string
  7427. var mv uint64
  7428. hasLen := containerLen > 0
  7429. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7430. if esep {
  7431. dd.ReadMapElemKey()
  7432. }
  7433. mk = dd.DecodeString()
  7434. if esep {
  7435. dd.ReadMapElemValue()
  7436. }
  7437. if dd.TryDecodeAsNil() {
  7438. if v == nil {
  7439. } else if d.h.DeleteOnNilMapValue {
  7440. delete(v, mk)
  7441. } else {
  7442. v[mk] = 0
  7443. }
  7444. continue
  7445. }
  7446. mv = dd.DecodeUint64()
  7447. if v != nil {
  7448. v[mk] = mv
  7449. }
  7450. }
  7451. dd.ReadMapEnd()
  7452. d.depthDecr()
  7453. return v, changed
  7454. }
  7455. func (d *Decoder) fastpathDecMapStringUintptrR(f *codecFnInfo, rv reflect.Value) {
  7456. if rv.Kind() == reflect.Ptr {
  7457. vp := rv2i(rv).(*map[string]uintptr)
  7458. v, changed := fastpathTV.DecMapStringUintptrV(*vp, true, d)
  7459. if changed {
  7460. *vp = v
  7461. }
  7462. } else {
  7463. fastpathTV.DecMapStringUintptrV(rv2i(rv).(map[string]uintptr), false, d)
  7464. }
  7465. }
  7466. func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, d *Decoder) {
  7467. v, changed := f.DecMapStringUintptrV(*vp, true, d)
  7468. if changed {
  7469. *vp = v
  7470. }
  7471. }
  7472. func (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, canChange bool,
  7473. d *Decoder) (_ map[string]uintptr, changed bool) {
  7474. dd, esep := d.d, d.hh.hasElemSeparators()
  7475. containerLen := dd.ReadMapStart()
  7476. if canChange && v == nil {
  7477. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7478. v = make(map[string]uintptr, xlen)
  7479. changed = true
  7480. }
  7481. if containerLen == 0 {
  7482. dd.ReadMapEnd()
  7483. return v, changed
  7484. }
  7485. d.depthIncr()
  7486. var mk string
  7487. var mv uintptr
  7488. hasLen := containerLen > 0
  7489. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7490. if esep {
  7491. dd.ReadMapElemKey()
  7492. }
  7493. mk = dd.DecodeString()
  7494. if esep {
  7495. dd.ReadMapElemValue()
  7496. }
  7497. if dd.TryDecodeAsNil() {
  7498. if v == nil {
  7499. } else if d.h.DeleteOnNilMapValue {
  7500. delete(v, mk)
  7501. } else {
  7502. v[mk] = 0
  7503. }
  7504. continue
  7505. }
  7506. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7507. if v != nil {
  7508. v[mk] = mv
  7509. }
  7510. }
  7511. dd.ReadMapEnd()
  7512. d.depthDecr()
  7513. return v, changed
  7514. }
  7515. func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  7516. if rv.Kind() == reflect.Ptr {
  7517. vp := rv2i(rv).(*map[string]int)
  7518. v, changed := fastpathTV.DecMapStringIntV(*vp, true, d)
  7519. if changed {
  7520. *vp = v
  7521. }
  7522. } else {
  7523. fastpathTV.DecMapStringIntV(rv2i(rv).(map[string]int), false, d)
  7524. }
  7525. }
  7526. func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
  7527. v, changed := f.DecMapStringIntV(*vp, true, d)
  7528. if changed {
  7529. *vp = v
  7530. }
  7531. }
  7532. func (_ fastpathT) DecMapStringIntV(v map[string]int, canChange bool,
  7533. d *Decoder) (_ map[string]int, changed bool) {
  7534. dd, esep := d.d, d.hh.hasElemSeparators()
  7535. containerLen := dd.ReadMapStart()
  7536. if canChange && v == nil {
  7537. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7538. v = make(map[string]int, xlen)
  7539. changed = true
  7540. }
  7541. if containerLen == 0 {
  7542. dd.ReadMapEnd()
  7543. return v, changed
  7544. }
  7545. d.depthIncr()
  7546. var mk string
  7547. var mv int
  7548. hasLen := containerLen > 0
  7549. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7550. if esep {
  7551. dd.ReadMapElemKey()
  7552. }
  7553. mk = dd.DecodeString()
  7554. if esep {
  7555. dd.ReadMapElemValue()
  7556. }
  7557. if dd.TryDecodeAsNil() {
  7558. if v == nil {
  7559. } else if d.h.DeleteOnNilMapValue {
  7560. delete(v, mk)
  7561. } else {
  7562. v[mk] = 0
  7563. }
  7564. continue
  7565. }
  7566. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  7567. if v != nil {
  7568. v[mk] = mv
  7569. }
  7570. }
  7571. dd.ReadMapEnd()
  7572. d.depthDecr()
  7573. return v, changed
  7574. }
  7575. func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  7576. if rv.Kind() == reflect.Ptr {
  7577. vp := rv2i(rv).(*map[string]int64)
  7578. v, changed := fastpathTV.DecMapStringInt64V(*vp, true, d)
  7579. if changed {
  7580. *vp = v
  7581. }
  7582. } else {
  7583. fastpathTV.DecMapStringInt64V(rv2i(rv).(map[string]int64), false, d)
  7584. }
  7585. }
  7586. func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) {
  7587. v, changed := f.DecMapStringInt64V(*vp, true, d)
  7588. if changed {
  7589. *vp = v
  7590. }
  7591. }
  7592. func (_ fastpathT) DecMapStringInt64V(v map[string]int64, canChange bool,
  7593. d *Decoder) (_ map[string]int64, changed bool) {
  7594. dd, esep := d.d, d.hh.hasElemSeparators()
  7595. containerLen := dd.ReadMapStart()
  7596. if canChange && v == nil {
  7597. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7598. v = make(map[string]int64, xlen)
  7599. changed = true
  7600. }
  7601. if containerLen == 0 {
  7602. dd.ReadMapEnd()
  7603. return v, changed
  7604. }
  7605. d.depthIncr()
  7606. var mk string
  7607. var mv int64
  7608. hasLen := containerLen > 0
  7609. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7610. if esep {
  7611. dd.ReadMapElemKey()
  7612. }
  7613. mk = dd.DecodeString()
  7614. if esep {
  7615. dd.ReadMapElemValue()
  7616. }
  7617. if dd.TryDecodeAsNil() {
  7618. if v == nil {
  7619. } else if d.h.DeleteOnNilMapValue {
  7620. delete(v, mk)
  7621. } else {
  7622. v[mk] = 0
  7623. }
  7624. continue
  7625. }
  7626. mv = dd.DecodeInt64()
  7627. if v != nil {
  7628. v[mk] = mv
  7629. }
  7630. }
  7631. dd.ReadMapEnd()
  7632. d.depthDecr()
  7633. return v, changed
  7634. }
  7635. func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  7636. if rv.Kind() == reflect.Ptr {
  7637. vp := rv2i(rv).(*map[string]float32)
  7638. v, changed := fastpathTV.DecMapStringFloat32V(*vp, true, d)
  7639. if changed {
  7640. *vp = v
  7641. }
  7642. } else {
  7643. fastpathTV.DecMapStringFloat32V(rv2i(rv).(map[string]float32), false, d)
  7644. }
  7645. }
  7646. func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) {
  7647. v, changed := f.DecMapStringFloat32V(*vp, true, d)
  7648. if changed {
  7649. *vp = v
  7650. }
  7651. }
  7652. func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, canChange bool,
  7653. d *Decoder) (_ map[string]float32, changed bool) {
  7654. dd, esep := d.d, d.hh.hasElemSeparators()
  7655. containerLen := dd.ReadMapStart()
  7656. if canChange && v == nil {
  7657. xlen := decInferLen(containerLen, d.h.MaxInitLen, 20)
  7658. v = make(map[string]float32, xlen)
  7659. changed = true
  7660. }
  7661. if containerLen == 0 {
  7662. dd.ReadMapEnd()
  7663. return v, changed
  7664. }
  7665. d.depthIncr()
  7666. var mk string
  7667. var mv float32
  7668. hasLen := containerLen > 0
  7669. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7670. if esep {
  7671. dd.ReadMapElemKey()
  7672. }
  7673. mk = dd.DecodeString()
  7674. if esep {
  7675. dd.ReadMapElemValue()
  7676. }
  7677. if dd.TryDecodeAsNil() {
  7678. if v == nil {
  7679. } else if d.h.DeleteOnNilMapValue {
  7680. delete(v, mk)
  7681. } else {
  7682. v[mk] = 0
  7683. }
  7684. continue
  7685. }
  7686. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  7687. if v != nil {
  7688. v[mk] = mv
  7689. }
  7690. }
  7691. dd.ReadMapEnd()
  7692. d.depthDecr()
  7693. return v, changed
  7694. }
  7695. func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  7696. if rv.Kind() == reflect.Ptr {
  7697. vp := rv2i(rv).(*map[string]float64)
  7698. v, changed := fastpathTV.DecMapStringFloat64V(*vp, true, d)
  7699. if changed {
  7700. *vp = v
  7701. }
  7702. } else {
  7703. fastpathTV.DecMapStringFloat64V(rv2i(rv).(map[string]float64), false, d)
  7704. }
  7705. }
  7706. func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
  7707. v, changed := f.DecMapStringFloat64V(*vp, true, d)
  7708. if changed {
  7709. *vp = v
  7710. }
  7711. }
  7712. func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, canChange bool,
  7713. d *Decoder) (_ map[string]float64, changed bool) {
  7714. dd, esep := d.d, d.hh.hasElemSeparators()
  7715. containerLen := dd.ReadMapStart()
  7716. if canChange && v == nil {
  7717. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7718. v = make(map[string]float64, xlen)
  7719. changed = true
  7720. }
  7721. if containerLen == 0 {
  7722. dd.ReadMapEnd()
  7723. return v, changed
  7724. }
  7725. d.depthIncr()
  7726. var mk string
  7727. var mv float64
  7728. hasLen := containerLen > 0
  7729. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7730. if esep {
  7731. dd.ReadMapElemKey()
  7732. }
  7733. mk = dd.DecodeString()
  7734. if esep {
  7735. dd.ReadMapElemValue()
  7736. }
  7737. if dd.TryDecodeAsNil() {
  7738. if v == nil {
  7739. } else if d.h.DeleteOnNilMapValue {
  7740. delete(v, mk)
  7741. } else {
  7742. v[mk] = 0
  7743. }
  7744. continue
  7745. }
  7746. mv = dd.DecodeFloat64()
  7747. if v != nil {
  7748. v[mk] = mv
  7749. }
  7750. }
  7751. dd.ReadMapEnd()
  7752. d.depthDecr()
  7753. return v, changed
  7754. }
  7755. func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  7756. if rv.Kind() == reflect.Ptr {
  7757. vp := rv2i(rv).(*map[string]bool)
  7758. v, changed := fastpathTV.DecMapStringBoolV(*vp, true, d)
  7759. if changed {
  7760. *vp = v
  7761. }
  7762. } else {
  7763. fastpathTV.DecMapStringBoolV(rv2i(rv).(map[string]bool), false, d)
  7764. }
  7765. }
  7766. func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
  7767. v, changed := f.DecMapStringBoolV(*vp, true, d)
  7768. if changed {
  7769. *vp = v
  7770. }
  7771. }
  7772. func (_ fastpathT) DecMapStringBoolV(v map[string]bool, canChange bool,
  7773. d *Decoder) (_ map[string]bool, changed bool) {
  7774. dd, esep := d.d, d.hh.hasElemSeparators()
  7775. containerLen := dd.ReadMapStart()
  7776. if canChange && v == nil {
  7777. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  7778. v = make(map[string]bool, xlen)
  7779. changed = true
  7780. }
  7781. if containerLen == 0 {
  7782. dd.ReadMapEnd()
  7783. return v, changed
  7784. }
  7785. d.depthIncr()
  7786. var mk string
  7787. var mv bool
  7788. hasLen := containerLen > 0
  7789. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7790. if esep {
  7791. dd.ReadMapElemKey()
  7792. }
  7793. mk = dd.DecodeString()
  7794. if esep {
  7795. dd.ReadMapElemValue()
  7796. }
  7797. if dd.TryDecodeAsNil() {
  7798. if v == nil {
  7799. } else if d.h.DeleteOnNilMapValue {
  7800. delete(v, mk)
  7801. } else {
  7802. v[mk] = false
  7803. }
  7804. continue
  7805. }
  7806. mv = dd.DecodeBool()
  7807. if v != nil {
  7808. v[mk] = mv
  7809. }
  7810. }
  7811. dd.ReadMapEnd()
  7812. d.depthDecr()
  7813. return v, changed
  7814. }
  7815. func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  7816. if rv.Kind() == reflect.Ptr {
  7817. vp := rv2i(rv).(*map[uint]interface{})
  7818. v, changed := fastpathTV.DecMapUintIntfV(*vp, true, d)
  7819. if changed {
  7820. *vp = v
  7821. }
  7822. } else {
  7823. fastpathTV.DecMapUintIntfV(rv2i(rv).(map[uint]interface{}), false, d)
  7824. }
  7825. }
  7826. func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) {
  7827. v, changed := f.DecMapUintIntfV(*vp, true, d)
  7828. if changed {
  7829. *vp = v
  7830. }
  7831. }
  7832. func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, canChange bool,
  7833. d *Decoder) (_ map[uint]interface{}, changed bool) {
  7834. dd, esep := d.d, d.hh.hasElemSeparators()
  7835. containerLen := dd.ReadMapStart()
  7836. if canChange && v == nil {
  7837. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7838. v = make(map[uint]interface{}, xlen)
  7839. changed = true
  7840. }
  7841. if containerLen == 0 {
  7842. dd.ReadMapEnd()
  7843. return v, changed
  7844. }
  7845. d.depthIncr()
  7846. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7847. var mk uint
  7848. var mv interface{}
  7849. hasLen := containerLen > 0
  7850. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7851. if esep {
  7852. dd.ReadMapElemKey()
  7853. }
  7854. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7855. if esep {
  7856. dd.ReadMapElemValue()
  7857. }
  7858. if dd.TryDecodeAsNil() {
  7859. if v == nil {
  7860. } else if d.h.DeleteOnNilMapValue {
  7861. delete(v, mk)
  7862. } else {
  7863. v[mk] = nil
  7864. }
  7865. continue
  7866. }
  7867. if mapGet {
  7868. mv = v[mk]
  7869. } else {
  7870. mv = nil
  7871. }
  7872. d.decode(&mv)
  7873. if v != nil {
  7874. v[mk] = mv
  7875. }
  7876. }
  7877. dd.ReadMapEnd()
  7878. d.depthDecr()
  7879. return v, changed
  7880. }
  7881. func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  7882. if rv.Kind() == reflect.Ptr {
  7883. vp := rv2i(rv).(*map[uint]string)
  7884. v, changed := fastpathTV.DecMapUintStringV(*vp, true, d)
  7885. if changed {
  7886. *vp = v
  7887. }
  7888. } else {
  7889. fastpathTV.DecMapUintStringV(rv2i(rv).(map[uint]string), false, d)
  7890. }
  7891. }
  7892. func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) {
  7893. v, changed := f.DecMapUintStringV(*vp, true, d)
  7894. if changed {
  7895. *vp = v
  7896. }
  7897. }
  7898. func (_ fastpathT) DecMapUintStringV(v map[uint]string, canChange bool,
  7899. d *Decoder) (_ map[uint]string, changed bool) {
  7900. dd, esep := d.d, d.hh.hasElemSeparators()
  7901. containerLen := dd.ReadMapStart()
  7902. if canChange && v == nil {
  7903. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  7904. v = make(map[uint]string, xlen)
  7905. changed = true
  7906. }
  7907. if containerLen == 0 {
  7908. dd.ReadMapEnd()
  7909. return v, changed
  7910. }
  7911. d.depthIncr()
  7912. var mk uint
  7913. var mv string
  7914. hasLen := containerLen > 0
  7915. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7916. if esep {
  7917. dd.ReadMapElemKey()
  7918. }
  7919. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7920. if esep {
  7921. dd.ReadMapElemValue()
  7922. }
  7923. if dd.TryDecodeAsNil() {
  7924. if v == nil {
  7925. } else if d.h.DeleteOnNilMapValue {
  7926. delete(v, mk)
  7927. } else {
  7928. v[mk] = ""
  7929. }
  7930. continue
  7931. }
  7932. mv = dd.DecodeString()
  7933. if v != nil {
  7934. v[mk] = mv
  7935. }
  7936. }
  7937. dd.ReadMapEnd()
  7938. d.depthDecr()
  7939. return v, changed
  7940. }
  7941. func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  7942. if rv.Kind() == reflect.Ptr {
  7943. vp := rv2i(rv).(*map[uint]uint)
  7944. v, changed := fastpathTV.DecMapUintUintV(*vp, true, d)
  7945. if changed {
  7946. *vp = v
  7947. }
  7948. } else {
  7949. fastpathTV.DecMapUintUintV(rv2i(rv).(map[uint]uint), false, d)
  7950. }
  7951. }
  7952. func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) {
  7953. v, changed := f.DecMapUintUintV(*vp, true, d)
  7954. if changed {
  7955. *vp = v
  7956. }
  7957. }
  7958. func (_ fastpathT) DecMapUintUintV(v map[uint]uint, canChange bool,
  7959. d *Decoder) (_ map[uint]uint, changed bool) {
  7960. dd, esep := d.d, d.hh.hasElemSeparators()
  7961. containerLen := dd.ReadMapStart()
  7962. if canChange && v == nil {
  7963. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  7964. v = make(map[uint]uint, xlen)
  7965. changed = true
  7966. }
  7967. if containerLen == 0 {
  7968. dd.ReadMapEnd()
  7969. return v, changed
  7970. }
  7971. d.depthIncr()
  7972. var mk uint
  7973. var mv uint
  7974. hasLen := containerLen > 0
  7975. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  7976. if esep {
  7977. dd.ReadMapElemKey()
  7978. }
  7979. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7980. if esep {
  7981. dd.ReadMapElemValue()
  7982. }
  7983. if dd.TryDecodeAsNil() {
  7984. if v == nil {
  7985. } else if d.h.DeleteOnNilMapValue {
  7986. delete(v, mk)
  7987. } else {
  7988. v[mk] = 0
  7989. }
  7990. continue
  7991. }
  7992. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  7993. if v != nil {
  7994. v[mk] = mv
  7995. }
  7996. }
  7997. dd.ReadMapEnd()
  7998. d.depthDecr()
  7999. return v, changed
  8000. }
  8001. func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  8002. if rv.Kind() == reflect.Ptr {
  8003. vp := rv2i(rv).(*map[uint]uint8)
  8004. v, changed := fastpathTV.DecMapUintUint8V(*vp, true, d)
  8005. if changed {
  8006. *vp = v
  8007. }
  8008. } else {
  8009. fastpathTV.DecMapUintUint8V(rv2i(rv).(map[uint]uint8), false, d)
  8010. }
  8011. }
  8012. func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) {
  8013. v, changed := f.DecMapUintUint8V(*vp, true, d)
  8014. if changed {
  8015. *vp = v
  8016. }
  8017. }
  8018. func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, canChange bool,
  8019. d *Decoder) (_ map[uint]uint8, changed bool) {
  8020. dd, esep := d.d, d.hh.hasElemSeparators()
  8021. containerLen := dd.ReadMapStart()
  8022. if canChange && v == nil {
  8023. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8024. v = make(map[uint]uint8, xlen)
  8025. changed = true
  8026. }
  8027. if containerLen == 0 {
  8028. dd.ReadMapEnd()
  8029. return v, changed
  8030. }
  8031. d.depthIncr()
  8032. var mk uint
  8033. var mv uint8
  8034. hasLen := containerLen > 0
  8035. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8036. if esep {
  8037. dd.ReadMapElemKey()
  8038. }
  8039. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8040. if esep {
  8041. dd.ReadMapElemValue()
  8042. }
  8043. if dd.TryDecodeAsNil() {
  8044. if v == nil {
  8045. } else if d.h.DeleteOnNilMapValue {
  8046. delete(v, mk)
  8047. } else {
  8048. v[mk] = 0
  8049. }
  8050. continue
  8051. }
  8052. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8053. if v != nil {
  8054. v[mk] = mv
  8055. }
  8056. }
  8057. dd.ReadMapEnd()
  8058. d.depthDecr()
  8059. return v, changed
  8060. }
  8061. func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  8062. if rv.Kind() == reflect.Ptr {
  8063. vp := rv2i(rv).(*map[uint]uint64)
  8064. v, changed := fastpathTV.DecMapUintUint64V(*vp, true, d)
  8065. if changed {
  8066. *vp = v
  8067. }
  8068. } else {
  8069. fastpathTV.DecMapUintUint64V(rv2i(rv).(map[uint]uint64), false, d)
  8070. }
  8071. }
  8072. func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) {
  8073. v, changed := f.DecMapUintUint64V(*vp, true, d)
  8074. if changed {
  8075. *vp = v
  8076. }
  8077. }
  8078. func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, canChange bool,
  8079. d *Decoder) (_ map[uint]uint64, changed bool) {
  8080. dd, esep := d.d, d.hh.hasElemSeparators()
  8081. containerLen := dd.ReadMapStart()
  8082. if canChange && v == nil {
  8083. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8084. v = make(map[uint]uint64, xlen)
  8085. changed = true
  8086. }
  8087. if containerLen == 0 {
  8088. dd.ReadMapEnd()
  8089. return v, changed
  8090. }
  8091. d.depthIncr()
  8092. var mk uint
  8093. var mv uint64
  8094. hasLen := containerLen > 0
  8095. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8096. if esep {
  8097. dd.ReadMapElemKey()
  8098. }
  8099. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8100. if esep {
  8101. dd.ReadMapElemValue()
  8102. }
  8103. if dd.TryDecodeAsNil() {
  8104. if v == nil {
  8105. } else if d.h.DeleteOnNilMapValue {
  8106. delete(v, mk)
  8107. } else {
  8108. v[mk] = 0
  8109. }
  8110. continue
  8111. }
  8112. mv = dd.DecodeUint64()
  8113. if v != nil {
  8114. v[mk] = mv
  8115. }
  8116. }
  8117. dd.ReadMapEnd()
  8118. d.depthDecr()
  8119. return v, changed
  8120. }
  8121. func (d *Decoder) fastpathDecMapUintUintptrR(f *codecFnInfo, rv reflect.Value) {
  8122. if rv.Kind() == reflect.Ptr {
  8123. vp := rv2i(rv).(*map[uint]uintptr)
  8124. v, changed := fastpathTV.DecMapUintUintptrV(*vp, true, d)
  8125. if changed {
  8126. *vp = v
  8127. }
  8128. } else {
  8129. fastpathTV.DecMapUintUintptrV(rv2i(rv).(map[uint]uintptr), false, d)
  8130. }
  8131. }
  8132. func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, d *Decoder) {
  8133. v, changed := f.DecMapUintUintptrV(*vp, true, d)
  8134. if changed {
  8135. *vp = v
  8136. }
  8137. }
  8138. func (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, canChange bool,
  8139. d *Decoder) (_ map[uint]uintptr, changed bool) {
  8140. dd, esep := d.d, d.hh.hasElemSeparators()
  8141. containerLen := dd.ReadMapStart()
  8142. if canChange && v == nil {
  8143. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8144. v = make(map[uint]uintptr, xlen)
  8145. changed = true
  8146. }
  8147. if containerLen == 0 {
  8148. dd.ReadMapEnd()
  8149. return v, changed
  8150. }
  8151. d.depthIncr()
  8152. var mk uint
  8153. var mv uintptr
  8154. hasLen := containerLen > 0
  8155. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8156. if esep {
  8157. dd.ReadMapElemKey()
  8158. }
  8159. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8160. if esep {
  8161. dd.ReadMapElemValue()
  8162. }
  8163. if dd.TryDecodeAsNil() {
  8164. if v == nil {
  8165. } else if d.h.DeleteOnNilMapValue {
  8166. delete(v, mk)
  8167. } else {
  8168. v[mk] = 0
  8169. }
  8170. continue
  8171. }
  8172. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8173. if v != nil {
  8174. v[mk] = mv
  8175. }
  8176. }
  8177. dd.ReadMapEnd()
  8178. d.depthDecr()
  8179. return v, changed
  8180. }
  8181. func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  8182. if rv.Kind() == reflect.Ptr {
  8183. vp := rv2i(rv).(*map[uint]int)
  8184. v, changed := fastpathTV.DecMapUintIntV(*vp, true, d)
  8185. if changed {
  8186. *vp = v
  8187. }
  8188. } else {
  8189. fastpathTV.DecMapUintIntV(rv2i(rv).(map[uint]int), false, d)
  8190. }
  8191. }
  8192. func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) {
  8193. v, changed := f.DecMapUintIntV(*vp, true, d)
  8194. if changed {
  8195. *vp = v
  8196. }
  8197. }
  8198. func (_ fastpathT) DecMapUintIntV(v map[uint]int, canChange bool,
  8199. d *Decoder) (_ map[uint]int, changed bool) {
  8200. dd, esep := d.d, d.hh.hasElemSeparators()
  8201. containerLen := dd.ReadMapStart()
  8202. if canChange && v == nil {
  8203. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8204. v = make(map[uint]int, xlen)
  8205. changed = true
  8206. }
  8207. if containerLen == 0 {
  8208. dd.ReadMapEnd()
  8209. return v, changed
  8210. }
  8211. d.depthIncr()
  8212. var mk uint
  8213. var mv int
  8214. hasLen := containerLen > 0
  8215. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8216. if esep {
  8217. dd.ReadMapElemKey()
  8218. }
  8219. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8220. if esep {
  8221. dd.ReadMapElemValue()
  8222. }
  8223. if dd.TryDecodeAsNil() {
  8224. if v == nil {
  8225. } else if d.h.DeleteOnNilMapValue {
  8226. delete(v, mk)
  8227. } else {
  8228. v[mk] = 0
  8229. }
  8230. continue
  8231. }
  8232. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  8233. if v != nil {
  8234. v[mk] = mv
  8235. }
  8236. }
  8237. dd.ReadMapEnd()
  8238. d.depthDecr()
  8239. return v, changed
  8240. }
  8241. func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  8242. if rv.Kind() == reflect.Ptr {
  8243. vp := rv2i(rv).(*map[uint]int64)
  8244. v, changed := fastpathTV.DecMapUintInt64V(*vp, true, d)
  8245. if changed {
  8246. *vp = v
  8247. }
  8248. } else {
  8249. fastpathTV.DecMapUintInt64V(rv2i(rv).(map[uint]int64), false, d)
  8250. }
  8251. }
  8252. func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) {
  8253. v, changed := f.DecMapUintInt64V(*vp, true, d)
  8254. if changed {
  8255. *vp = v
  8256. }
  8257. }
  8258. func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, canChange bool,
  8259. d *Decoder) (_ map[uint]int64, changed bool) {
  8260. dd, esep := d.d, d.hh.hasElemSeparators()
  8261. containerLen := dd.ReadMapStart()
  8262. if canChange && v == nil {
  8263. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8264. v = make(map[uint]int64, xlen)
  8265. changed = true
  8266. }
  8267. if containerLen == 0 {
  8268. dd.ReadMapEnd()
  8269. return v, changed
  8270. }
  8271. d.depthIncr()
  8272. var mk uint
  8273. var mv int64
  8274. hasLen := containerLen > 0
  8275. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8276. if esep {
  8277. dd.ReadMapElemKey()
  8278. }
  8279. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8280. if esep {
  8281. dd.ReadMapElemValue()
  8282. }
  8283. if dd.TryDecodeAsNil() {
  8284. if v == nil {
  8285. } else if d.h.DeleteOnNilMapValue {
  8286. delete(v, mk)
  8287. } else {
  8288. v[mk] = 0
  8289. }
  8290. continue
  8291. }
  8292. mv = dd.DecodeInt64()
  8293. if v != nil {
  8294. v[mk] = mv
  8295. }
  8296. }
  8297. dd.ReadMapEnd()
  8298. d.depthDecr()
  8299. return v, changed
  8300. }
  8301. func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  8302. if rv.Kind() == reflect.Ptr {
  8303. vp := rv2i(rv).(*map[uint]float32)
  8304. v, changed := fastpathTV.DecMapUintFloat32V(*vp, true, d)
  8305. if changed {
  8306. *vp = v
  8307. }
  8308. } else {
  8309. fastpathTV.DecMapUintFloat32V(rv2i(rv).(map[uint]float32), false, d)
  8310. }
  8311. }
  8312. func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) {
  8313. v, changed := f.DecMapUintFloat32V(*vp, true, d)
  8314. if changed {
  8315. *vp = v
  8316. }
  8317. }
  8318. func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, canChange bool,
  8319. d *Decoder) (_ map[uint]float32, changed bool) {
  8320. dd, esep := d.d, d.hh.hasElemSeparators()
  8321. containerLen := dd.ReadMapStart()
  8322. if canChange && v == nil {
  8323. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  8324. v = make(map[uint]float32, xlen)
  8325. changed = true
  8326. }
  8327. if containerLen == 0 {
  8328. dd.ReadMapEnd()
  8329. return v, changed
  8330. }
  8331. d.depthIncr()
  8332. var mk uint
  8333. var mv float32
  8334. hasLen := containerLen > 0
  8335. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8336. if esep {
  8337. dd.ReadMapElemKey()
  8338. }
  8339. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8340. if esep {
  8341. dd.ReadMapElemValue()
  8342. }
  8343. if dd.TryDecodeAsNil() {
  8344. if v == nil {
  8345. } else if d.h.DeleteOnNilMapValue {
  8346. delete(v, mk)
  8347. } else {
  8348. v[mk] = 0
  8349. }
  8350. continue
  8351. }
  8352. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  8353. if v != nil {
  8354. v[mk] = mv
  8355. }
  8356. }
  8357. dd.ReadMapEnd()
  8358. d.depthDecr()
  8359. return v, changed
  8360. }
  8361. func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  8362. if rv.Kind() == reflect.Ptr {
  8363. vp := rv2i(rv).(*map[uint]float64)
  8364. v, changed := fastpathTV.DecMapUintFloat64V(*vp, true, d)
  8365. if changed {
  8366. *vp = v
  8367. }
  8368. } else {
  8369. fastpathTV.DecMapUintFloat64V(rv2i(rv).(map[uint]float64), false, d)
  8370. }
  8371. }
  8372. func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) {
  8373. v, changed := f.DecMapUintFloat64V(*vp, true, d)
  8374. if changed {
  8375. *vp = v
  8376. }
  8377. }
  8378. func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, canChange bool,
  8379. d *Decoder) (_ map[uint]float64, changed bool) {
  8380. dd, esep := d.d, d.hh.hasElemSeparators()
  8381. containerLen := dd.ReadMapStart()
  8382. if canChange && v == nil {
  8383. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  8384. v = make(map[uint]float64, xlen)
  8385. changed = true
  8386. }
  8387. if containerLen == 0 {
  8388. dd.ReadMapEnd()
  8389. return v, changed
  8390. }
  8391. d.depthIncr()
  8392. var mk uint
  8393. var mv float64
  8394. hasLen := containerLen > 0
  8395. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8396. if esep {
  8397. dd.ReadMapElemKey()
  8398. }
  8399. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8400. if esep {
  8401. dd.ReadMapElemValue()
  8402. }
  8403. if dd.TryDecodeAsNil() {
  8404. if v == nil {
  8405. } else if d.h.DeleteOnNilMapValue {
  8406. delete(v, mk)
  8407. } else {
  8408. v[mk] = 0
  8409. }
  8410. continue
  8411. }
  8412. mv = dd.DecodeFloat64()
  8413. if v != nil {
  8414. v[mk] = mv
  8415. }
  8416. }
  8417. dd.ReadMapEnd()
  8418. d.depthDecr()
  8419. return v, changed
  8420. }
  8421. func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  8422. if rv.Kind() == reflect.Ptr {
  8423. vp := rv2i(rv).(*map[uint]bool)
  8424. v, changed := fastpathTV.DecMapUintBoolV(*vp, true, d)
  8425. if changed {
  8426. *vp = v
  8427. }
  8428. } else {
  8429. fastpathTV.DecMapUintBoolV(rv2i(rv).(map[uint]bool), false, d)
  8430. }
  8431. }
  8432. func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) {
  8433. v, changed := f.DecMapUintBoolV(*vp, true, d)
  8434. if changed {
  8435. *vp = v
  8436. }
  8437. }
  8438. func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, canChange bool,
  8439. d *Decoder) (_ map[uint]bool, changed bool) {
  8440. dd, esep := d.d, d.hh.hasElemSeparators()
  8441. containerLen := dd.ReadMapStart()
  8442. if canChange && v == nil {
  8443. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8444. v = make(map[uint]bool, xlen)
  8445. changed = true
  8446. }
  8447. if containerLen == 0 {
  8448. dd.ReadMapEnd()
  8449. return v, changed
  8450. }
  8451. d.depthIncr()
  8452. var mk uint
  8453. var mv bool
  8454. hasLen := containerLen > 0
  8455. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8456. if esep {
  8457. dd.ReadMapElemKey()
  8458. }
  8459. mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8460. if esep {
  8461. dd.ReadMapElemValue()
  8462. }
  8463. if dd.TryDecodeAsNil() {
  8464. if v == nil {
  8465. } else if d.h.DeleteOnNilMapValue {
  8466. delete(v, mk)
  8467. } else {
  8468. v[mk] = false
  8469. }
  8470. continue
  8471. }
  8472. mv = dd.DecodeBool()
  8473. if v != nil {
  8474. v[mk] = mv
  8475. }
  8476. }
  8477. dd.ReadMapEnd()
  8478. d.depthDecr()
  8479. return v, changed
  8480. }
  8481. func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  8482. if rv.Kind() == reflect.Ptr {
  8483. vp := rv2i(rv).(*map[uint8]interface{})
  8484. v, changed := fastpathTV.DecMapUint8IntfV(*vp, true, d)
  8485. if changed {
  8486. *vp = v
  8487. }
  8488. } else {
  8489. fastpathTV.DecMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), false, d)
  8490. }
  8491. }
  8492. func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
  8493. v, changed := f.DecMapUint8IntfV(*vp, true, d)
  8494. if changed {
  8495. *vp = v
  8496. }
  8497. }
  8498. func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, canChange bool,
  8499. d *Decoder) (_ map[uint8]interface{}, changed bool) {
  8500. dd, esep := d.d, d.hh.hasElemSeparators()
  8501. containerLen := dd.ReadMapStart()
  8502. if canChange && v == nil {
  8503. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  8504. v = make(map[uint8]interface{}, xlen)
  8505. changed = true
  8506. }
  8507. if containerLen == 0 {
  8508. dd.ReadMapEnd()
  8509. return v, changed
  8510. }
  8511. d.depthIncr()
  8512. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  8513. var mk uint8
  8514. var mv interface{}
  8515. hasLen := containerLen > 0
  8516. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8517. if esep {
  8518. dd.ReadMapElemKey()
  8519. }
  8520. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8521. if esep {
  8522. dd.ReadMapElemValue()
  8523. }
  8524. if dd.TryDecodeAsNil() {
  8525. if v == nil {
  8526. } else if d.h.DeleteOnNilMapValue {
  8527. delete(v, mk)
  8528. } else {
  8529. v[mk] = nil
  8530. }
  8531. continue
  8532. }
  8533. if mapGet {
  8534. mv = v[mk]
  8535. } else {
  8536. mv = nil
  8537. }
  8538. d.decode(&mv)
  8539. if v != nil {
  8540. v[mk] = mv
  8541. }
  8542. }
  8543. dd.ReadMapEnd()
  8544. d.depthDecr()
  8545. return v, changed
  8546. }
  8547. func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  8548. if rv.Kind() == reflect.Ptr {
  8549. vp := rv2i(rv).(*map[uint8]string)
  8550. v, changed := fastpathTV.DecMapUint8StringV(*vp, true, d)
  8551. if changed {
  8552. *vp = v
  8553. }
  8554. } else {
  8555. fastpathTV.DecMapUint8StringV(rv2i(rv).(map[uint8]string), false, d)
  8556. }
  8557. }
  8558. func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
  8559. v, changed := f.DecMapUint8StringV(*vp, true, d)
  8560. if changed {
  8561. *vp = v
  8562. }
  8563. }
  8564. func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, canChange bool,
  8565. d *Decoder) (_ map[uint8]string, changed bool) {
  8566. dd, esep := d.d, d.hh.hasElemSeparators()
  8567. containerLen := dd.ReadMapStart()
  8568. if canChange && v == nil {
  8569. xlen := decInferLen(containerLen, d.h.MaxInitLen, 17)
  8570. v = make(map[uint8]string, xlen)
  8571. changed = true
  8572. }
  8573. if containerLen == 0 {
  8574. dd.ReadMapEnd()
  8575. return v, changed
  8576. }
  8577. d.depthIncr()
  8578. var mk uint8
  8579. var mv string
  8580. hasLen := containerLen > 0
  8581. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8582. if esep {
  8583. dd.ReadMapElemKey()
  8584. }
  8585. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8586. if esep {
  8587. dd.ReadMapElemValue()
  8588. }
  8589. if dd.TryDecodeAsNil() {
  8590. if v == nil {
  8591. } else if d.h.DeleteOnNilMapValue {
  8592. delete(v, mk)
  8593. } else {
  8594. v[mk] = ""
  8595. }
  8596. continue
  8597. }
  8598. mv = dd.DecodeString()
  8599. if v != nil {
  8600. v[mk] = mv
  8601. }
  8602. }
  8603. dd.ReadMapEnd()
  8604. d.depthDecr()
  8605. return v, changed
  8606. }
  8607. func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  8608. if rv.Kind() == reflect.Ptr {
  8609. vp := rv2i(rv).(*map[uint8]uint)
  8610. v, changed := fastpathTV.DecMapUint8UintV(*vp, true, d)
  8611. if changed {
  8612. *vp = v
  8613. }
  8614. } else {
  8615. fastpathTV.DecMapUint8UintV(rv2i(rv).(map[uint8]uint), false, d)
  8616. }
  8617. }
  8618. func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) {
  8619. v, changed := f.DecMapUint8UintV(*vp, true, d)
  8620. if changed {
  8621. *vp = v
  8622. }
  8623. }
  8624. func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, canChange bool,
  8625. d *Decoder) (_ map[uint8]uint, changed bool) {
  8626. dd, esep := d.d, d.hh.hasElemSeparators()
  8627. containerLen := dd.ReadMapStart()
  8628. if canChange && v == nil {
  8629. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8630. v = make(map[uint8]uint, xlen)
  8631. changed = true
  8632. }
  8633. if containerLen == 0 {
  8634. dd.ReadMapEnd()
  8635. return v, changed
  8636. }
  8637. d.depthIncr()
  8638. var mk uint8
  8639. var mv uint
  8640. hasLen := containerLen > 0
  8641. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8642. if esep {
  8643. dd.ReadMapElemKey()
  8644. }
  8645. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8646. if esep {
  8647. dd.ReadMapElemValue()
  8648. }
  8649. if dd.TryDecodeAsNil() {
  8650. if v == nil {
  8651. } else if d.h.DeleteOnNilMapValue {
  8652. delete(v, mk)
  8653. } else {
  8654. v[mk] = 0
  8655. }
  8656. continue
  8657. }
  8658. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8659. if v != nil {
  8660. v[mk] = mv
  8661. }
  8662. }
  8663. dd.ReadMapEnd()
  8664. d.depthDecr()
  8665. return v, changed
  8666. }
  8667. func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  8668. if rv.Kind() == reflect.Ptr {
  8669. vp := rv2i(rv).(*map[uint8]uint8)
  8670. v, changed := fastpathTV.DecMapUint8Uint8V(*vp, true, d)
  8671. if changed {
  8672. *vp = v
  8673. }
  8674. } else {
  8675. fastpathTV.DecMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), false, d)
  8676. }
  8677. }
  8678. func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
  8679. v, changed := f.DecMapUint8Uint8V(*vp, true, d)
  8680. if changed {
  8681. *vp = v
  8682. }
  8683. }
  8684. func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, canChange bool,
  8685. d *Decoder) (_ map[uint8]uint8, changed bool) {
  8686. dd, esep := d.d, d.hh.hasElemSeparators()
  8687. containerLen := dd.ReadMapStart()
  8688. if canChange && v == nil {
  8689. xlen := decInferLen(containerLen, d.h.MaxInitLen, 2)
  8690. v = make(map[uint8]uint8, xlen)
  8691. changed = true
  8692. }
  8693. if containerLen == 0 {
  8694. dd.ReadMapEnd()
  8695. return v, changed
  8696. }
  8697. d.depthIncr()
  8698. var mk uint8
  8699. var mv uint8
  8700. hasLen := containerLen > 0
  8701. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8702. if esep {
  8703. dd.ReadMapElemKey()
  8704. }
  8705. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8706. if esep {
  8707. dd.ReadMapElemValue()
  8708. }
  8709. if dd.TryDecodeAsNil() {
  8710. if v == nil {
  8711. } else if d.h.DeleteOnNilMapValue {
  8712. delete(v, mk)
  8713. } else {
  8714. v[mk] = 0
  8715. }
  8716. continue
  8717. }
  8718. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8719. if v != nil {
  8720. v[mk] = mv
  8721. }
  8722. }
  8723. dd.ReadMapEnd()
  8724. d.depthDecr()
  8725. return v, changed
  8726. }
  8727. func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  8728. if rv.Kind() == reflect.Ptr {
  8729. vp := rv2i(rv).(*map[uint8]uint64)
  8730. v, changed := fastpathTV.DecMapUint8Uint64V(*vp, true, d)
  8731. if changed {
  8732. *vp = v
  8733. }
  8734. } else {
  8735. fastpathTV.DecMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), false, d)
  8736. }
  8737. }
  8738. func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
  8739. v, changed := f.DecMapUint8Uint64V(*vp, true, d)
  8740. if changed {
  8741. *vp = v
  8742. }
  8743. }
  8744. func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, canChange bool,
  8745. d *Decoder) (_ map[uint8]uint64, changed bool) {
  8746. dd, esep := d.d, d.hh.hasElemSeparators()
  8747. containerLen := dd.ReadMapStart()
  8748. if canChange && v == nil {
  8749. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8750. v = make(map[uint8]uint64, xlen)
  8751. changed = true
  8752. }
  8753. if containerLen == 0 {
  8754. dd.ReadMapEnd()
  8755. return v, changed
  8756. }
  8757. d.depthIncr()
  8758. var mk uint8
  8759. var mv uint64
  8760. hasLen := containerLen > 0
  8761. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8762. if esep {
  8763. dd.ReadMapElemKey()
  8764. }
  8765. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8766. if esep {
  8767. dd.ReadMapElemValue()
  8768. }
  8769. if dd.TryDecodeAsNil() {
  8770. if v == nil {
  8771. } else if d.h.DeleteOnNilMapValue {
  8772. delete(v, mk)
  8773. } else {
  8774. v[mk] = 0
  8775. }
  8776. continue
  8777. }
  8778. mv = dd.DecodeUint64()
  8779. if v != nil {
  8780. v[mk] = mv
  8781. }
  8782. }
  8783. dd.ReadMapEnd()
  8784. d.depthDecr()
  8785. return v, changed
  8786. }
  8787. func (d *Decoder) fastpathDecMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) {
  8788. if rv.Kind() == reflect.Ptr {
  8789. vp := rv2i(rv).(*map[uint8]uintptr)
  8790. v, changed := fastpathTV.DecMapUint8UintptrV(*vp, true, d)
  8791. if changed {
  8792. *vp = v
  8793. }
  8794. } else {
  8795. fastpathTV.DecMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), false, d)
  8796. }
  8797. }
  8798. func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, d *Decoder) {
  8799. v, changed := f.DecMapUint8UintptrV(*vp, true, d)
  8800. if changed {
  8801. *vp = v
  8802. }
  8803. }
  8804. func (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, canChange bool,
  8805. d *Decoder) (_ map[uint8]uintptr, changed bool) {
  8806. dd, esep := d.d, d.hh.hasElemSeparators()
  8807. containerLen := dd.ReadMapStart()
  8808. if canChange && v == nil {
  8809. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8810. v = make(map[uint8]uintptr, xlen)
  8811. changed = true
  8812. }
  8813. if containerLen == 0 {
  8814. dd.ReadMapEnd()
  8815. return v, changed
  8816. }
  8817. d.depthIncr()
  8818. var mk uint8
  8819. var mv uintptr
  8820. hasLen := containerLen > 0
  8821. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8822. if esep {
  8823. dd.ReadMapElemKey()
  8824. }
  8825. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8826. if esep {
  8827. dd.ReadMapElemValue()
  8828. }
  8829. if dd.TryDecodeAsNil() {
  8830. if v == nil {
  8831. } else if d.h.DeleteOnNilMapValue {
  8832. delete(v, mk)
  8833. } else {
  8834. v[mk] = 0
  8835. }
  8836. continue
  8837. }
  8838. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  8839. if v != nil {
  8840. v[mk] = mv
  8841. }
  8842. }
  8843. dd.ReadMapEnd()
  8844. d.depthDecr()
  8845. return v, changed
  8846. }
  8847. func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  8848. if rv.Kind() == reflect.Ptr {
  8849. vp := rv2i(rv).(*map[uint8]int)
  8850. v, changed := fastpathTV.DecMapUint8IntV(*vp, true, d)
  8851. if changed {
  8852. *vp = v
  8853. }
  8854. } else {
  8855. fastpathTV.DecMapUint8IntV(rv2i(rv).(map[uint8]int), false, d)
  8856. }
  8857. }
  8858. func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
  8859. v, changed := f.DecMapUint8IntV(*vp, true, d)
  8860. if changed {
  8861. *vp = v
  8862. }
  8863. }
  8864. func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, canChange bool,
  8865. d *Decoder) (_ map[uint8]int, changed bool) {
  8866. dd, esep := d.d, d.hh.hasElemSeparators()
  8867. containerLen := dd.ReadMapStart()
  8868. if canChange && v == nil {
  8869. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8870. v = make(map[uint8]int, xlen)
  8871. changed = true
  8872. }
  8873. if containerLen == 0 {
  8874. dd.ReadMapEnd()
  8875. return v, changed
  8876. }
  8877. d.depthIncr()
  8878. var mk uint8
  8879. var mv int
  8880. hasLen := containerLen > 0
  8881. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8882. if esep {
  8883. dd.ReadMapElemKey()
  8884. }
  8885. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8886. if esep {
  8887. dd.ReadMapElemValue()
  8888. }
  8889. if dd.TryDecodeAsNil() {
  8890. if v == nil {
  8891. } else if d.h.DeleteOnNilMapValue {
  8892. delete(v, mk)
  8893. } else {
  8894. v[mk] = 0
  8895. }
  8896. continue
  8897. }
  8898. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  8899. if v != nil {
  8900. v[mk] = mv
  8901. }
  8902. }
  8903. dd.ReadMapEnd()
  8904. d.depthDecr()
  8905. return v, changed
  8906. }
  8907. func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  8908. if rv.Kind() == reflect.Ptr {
  8909. vp := rv2i(rv).(*map[uint8]int64)
  8910. v, changed := fastpathTV.DecMapUint8Int64V(*vp, true, d)
  8911. if changed {
  8912. *vp = v
  8913. }
  8914. } else {
  8915. fastpathTV.DecMapUint8Int64V(rv2i(rv).(map[uint8]int64), false, d)
  8916. }
  8917. }
  8918. func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) {
  8919. v, changed := f.DecMapUint8Int64V(*vp, true, d)
  8920. if changed {
  8921. *vp = v
  8922. }
  8923. }
  8924. func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, canChange bool,
  8925. d *Decoder) (_ map[uint8]int64, changed bool) {
  8926. dd, esep := d.d, d.hh.hasElemSeparators()
  8927. containerLen := dd.ReadMapStart()
  8928. if canChange && v == nil {
  8929. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  8930. v = make(map[uint8]int64, xlen)
  8931. changed = true
  8932. }
  8933. if containerLen == 0 {
  8934. dd.ReadMapEnd()
  8935. return v, changed
  8936. }
  8937. d.depthIncr()
  8938. var mk uint8
  8939. var mv int64
  8940. hasLen := containerLen > 0
  8941. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  8942. if esep {
  8943. dd.ReadMapElemKey()
  8944. }
  8945. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  8946. if esep {
  8947. dd.ReadMapElemValue()
  8948. }
  8949. if dd.TryDecodeAsNil() {
  8950. if v == nil {
  8951. } else if d.h.DeleteOnNilMapValue {
  8952. delete(v, mk)
  8953. } else {
  8954. v[mk] = 0
  8955. }
  8956. continue
  8957. }
  8958. mv = dd.DecodeInt64()
  8959. if v != nil {
  8960. v[mk] = mv
  8961. }
  8962. }
  8963. dd.ReadMapEnd()
  8964. d.depthDecr()
  8965. return v, changed
  8966. }
  8967. func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  8968. if rv.Kind() == reflect.Ptr {
  8969. vp := rv2i(rv).(*map[uint8]float32)
  8970. v, changed := fastpathTV.DecMapUint8Float32V(*vp, true, d)
  8971. if changed {
  8972. *vp = v
  8973. }
  8974. } else {
  8975. fastpathTV.DecMapUint8Float32V(rv2i(rv).(map[uint8]float32), false, d)
  8976. }
  8977. }
  8978. func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) {
  8979. v, changed := f.DecMapUint8Float32V(*vp, true, d)
  8980. if changed {
  8981. *vp = v
  8982. }
  8983. }
  8984. func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, canChange bool,
  8985. d *Decoder) (_ map[uint8]float32, changed bool) {
  8986. dd, esep := d.d, d.hh.hasElemSeparators()
  8987. containerLen := dd.ReadMapStart()
  8988. if canChange && v == nil {
  8989. xlen := decInferLen(containerLen, d.h.MaxInitLen, 5)
  8990. v = make(map[uint8]float32, xlen)
  8991. changed = true
  8992. }
  8993. if containerLen == 0 {
  8994. dd.ReadMapEnd()
  8995. return v, changed
  8996. }
  8997. d.depthIncr()
  8998. var mk uint8
  8999. var mv float32
  9000. hasLen := containerLen > 0
  9001. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9002. if esep {
  9003. dd.ReadMapElemKey()
  9004. }
  9005. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  9006. if esep {
  9007. dd.ReadMapElemValue()
  9008. }
  9009. if dd.TryDecodeAsNil() {
  9010. if v == nil {
  9011. } else if d.h.DeleteOnNilMapValue {
  9012. delete(v, mk)
  9013. } else {
  9014. v[mk] = 0
  9015. }
  9016. continue
  9017. }
  9018. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  9019. if v != nil {
  9020. v[mk] = mv
  9021. }
  9022. }
  9023. dd.ReadMapEnd()
  9024. d.depthDecr()
  9025. return v, changed
  9026. }
  9027. func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  9028. if rv.Kind() == reflect.Ptr {
  9029. vp := rv2i(rv).(*map[uint8]float64)
  9030. v, changed := fastpathTV.DecMapUint8Float64V(*vp, true, d)
  9031. if changed {
  9032. *vp = v
  9033. }
  9034. } else {
  9035. fastpathTV.DecMapUint8Float64V(rv2i(rv).(map[uint8]float64), false, d)
  9036. }
  9037. }
  9038. func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
  9039. v, changed := f.DecMapUint8Float64V(*vp, true, d)
  9040. if changed {
  9041. *vp = v
  9042. }
  9043. }
  9044. func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, canChange bool,
  9045. d *Decoder) (_ map[uint8]float64, changed bool) {
  9046. dd, esep := d.d, d.hh.hasElemSeparators()
  9047. containerLen := dd.ReadMapStart()
  9048. if canChange && v == nil {
  9049. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9050. v = make(map[uint8]float64, xlen)
  9051. changed = true
  9052. }
  9053. if containerLen == 0 {
  9054. dd.ReadMapEnd()
  9055. return v, changed
  9056. }
  9057. d.depthIncr()
  9058. var mk uint8
  9059. var mv float64
  9060. hasLen := containerLen > 0
  9061. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9062. if esep {
  9063. dd.ReadMapElemKey()
  9064. }
  9065. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  9066. if esep {
  9067. dd.ReadMapElemValue()
  9068. }
  9069. if dd.TryDecodeAsNil() {
  9070. if v == nil {
  9071. } else if d.h.DeleteOnNilMapValue {
  9072. delete(v, mk)
  9073. } else {
  9074. v[mk] = 0
  9075. }
  9076. continue
  9077. }
  9078. mv = dd.DecodeFloat64()
  9079. if v != nil {
  9080. v[mk] = mv
  9081. }
  9082. }
  9083. dd.ReadMapEnd()
  9084. d.depthDecr()
  9085. return v, changed
  9086. }
  9087. func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  9088. if rv.Kind() == reflect.Ptr {
  9089. vp := rv2i(rv).(*map[uint8]bool)
  9090. v, changed := fastpathTV.DecMapUint8BoolV(*vp, true, d)
  9091. if changed {
  9092. *vp = v
  9093. }
  9094. } else {
  9095. fastpathTV.DecMapUint8BoolV(rv2i(rv).(map[uint8]bool), false, d)
  9096. }
  9097. }
  9098. func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
  9099. v, changed := f.DecMapUint8BoolV(*vp, true, d)
  9100. if changed {
  9101. *vp = v
  9102. }
  9103. }
  9104. func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, canChange bool,
  9105. d *Decoder) (_ map[uint8]bool, changed bool) {
  9106. dd, esep := d.d, d.hh.hasElemSeparators()
  9107. containerLen := dd.ReadMapStart()
  9108. if canChange && v == nil {
  9109. xlen := decInferLen(containerLen, d.h.MaxInitLen, 2)
  9110. v = make(map[uint8]bool, xlen)
  9111. changed = true
  9112. }
  9113. if containerLen == 0 {
  9114. dd.ReadMapEnd()
  9115. return v, changed
  9116. }
  9117. d.depthIncr()
  9118. var mk uint8
  9119. var mv bool
  9120. hasLen := containerLen > 0
  9121. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9122. if esep {
  9123. dd.ReadMapElemKey()
  9124. }
  9125. mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  9126. if esep {
  9127. dd.ReadMapElemValue()
  9128. }
  9129. if dd.TryDecodeAsNil() {
  9130. if v == nil {
  9131. } else if d.h.DeleteOnNilMapValue {
  9132. delete(v, mk)
  9133. } else {
  9134. v[mk] = false
  9135. }
  9136. continue
  9137. }
  9138. mv = dd.DecodeBool()
  9139. if v != nil {
  9140. v[mk] = mv
  9141. }
  9142. }
  9143. dd.ReadMapEnd()
  9144. d.depthDecr()
  9145. return v, changed
  9146. }
  9147. func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  9148. if rv.Kind() == reflect.Ptr {
  9149. vp := rv2i(rv).(*map[uint64]interface{})
  9150. v, changed := fastpathTV.DecMapUint64IntfV(*vp, true, d)
  9151. if changed {
  9152. *vp = v
  9153. }
  9154. } else {
  9155. fastpathTV.DecMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), false, d)
  9156. }
  9157. }
  9158. func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
  9159. v, changed := f.DecMapUint64IntfV(*vp, true, d)
  9160. if changed {
  9161. *vp = v
  9162. }
  9163. }
  9164. func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, canChange bool,
  9165. d *Decoder) (_ map[uint64]interface{}, changed bool) {
  9166. dd, esep := d.d, d.hh.hasElemSeparators()
  9167. containerLen := dd.ReadMapStart()
  9168. if canChange && v == nil {
  9169. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9170. v = make(map[uint64]interface{}, xlen)
  9171. changed = true
  9172. }
  9173. if containerLen == 0 {
  9174. dd.ReadMapEnd()
  9175. return v, changed
  9176. }
  9177. d.depthIncr()
  9178. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  9179. var mk uint64
  9180. var mv interface{}
  9181. hasLen := containerLen > 0
  9182. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9183. if esep {
  9184. dd.ReadMapElemKey()
  9185. }
  9186. mk = dd.DecodeUint64()
  9187. if esep {
  9188. dd.ReadMapElemValue()
  9189. }
  9190. if dd.TryDecodeAsNil() {
  9191. if v == nil {
  9192. } else if d.h.DeleteOnNilMapValue {
  9193. delete(v, mk)
  9194. } else {
  9195. v[mk] = nil
  9196. }
  9197. continue
  9198. }
  9199. if mapGet {
  9200. mv = v[mk]
  9201. } else {
  9202. mv = nil
  9203. }
  9204. d.decode(&mv)
  9205. if v != nil {
  9206. v[mk] = mv
  9207. }
  9208. }
  9209. dd.ReadMapEnd()
  9210. d.depthDecr()
  9211. return v, changed
  9212. }
  9213. func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  9214. if rv.Kind() == reflect.Ptr {
  9215. vp := rv2i(rv).(*map[uint64]string)
  9216. v, changed := fastpathTV.DecMapUint64StringV(*vp, true, d)
  9217. if changed {
  9218. *vp = v
  9219. }
  9220. } else {
  9221. fastpathTV.DecMapUint64StringV(rv2i(rv).(map[uint64]string), false, d)
  9222. }
  9223. }
  9224. func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
  9225. v, changed := f.DecMapUint64StringV(*vp, true, d)
  9226. if changed {
  9227. *vp = v
  9228. }
  9229. }
  9230. func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, canChange bool,
  9231. d *Decoder) (_ map[uint64]string, changed bool) {
  9232. dd, esep := d.d, d.hh.hasElemSeparators()
  9233. containerLen := dd.ReadMapStart()
  9234. if canChange && v == nil {
  9235. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9236. v = make(map[uint64]string, xlen)
  9237. changed = true
  9238. }
  9239. if containerLen == 0 {
  9240. dd.ReadMapEnd()
  9241. return v, changed
  9242. }
  9243. d.depthIncr()
  9244. var mk uint64
  9245. var mv string
  9246. hasLen := containerLen > 0
  9247. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9248. if esep {
  9249. dd.ReadMapElemKey()
  9250. }
  9251. mk = dd.DecodeUint64()
  9252. if esep {
  9253. dd.ReadMapElemValue()
  9254. }
  9255. if dd.TryDecodeAsNil() {
  9256. if v == nil {
  9257. } else if d.h.DeleteOnNilMapValue {
  9258. delete(v, mk)
  9259. } else {
  9260. v[mk] = ""
  9261. }
  9262. continue
  9263. }
  9264. mv = dd.DecodeString()
  9265. if v != nil {
  9266. v[mk] = mv
  9267. }
  9268. }
  9269. dd.ReadMapEnd()
  9270. d.depthDecr()
  9271. return v, changed
  9272. }
  9273. func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  9274. if rv.Kind() == reflect.Ptr {
  9275. vp := rv2i(rv).(*map[uint64]uint)
  9276. v, changed := fastpathTV.DecMapUint64UintV(*vp, true, d)
  9277. if changed {
  9278. *vp = v
  9279. }
  9280. } else {
  9281. fastpathTV.DecMapUint64UintV(rv2i(rv).(map[uint64]uint), false, d)
  9282. }
  9283. }
  9284. func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) {
  9285. v, changed := f.DecMapUint64UintV(*vp, true, d)
  9286. if changed {
  9287. *vp = v
  9288. }
  9289. }
  9290. func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, canChange bool,
  9291. d *Decoder) (_ map[uint64]uint, changed bool) {
  9292. dd, esep := d.d, d.hh.hasElemSeparators()
  9293. containerLen := dd.ReadMapStart()
  9294. if canChange && v == nil {
  9295. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9296. v = make(map[uint64]uint, xlen)
  9297. changed = true
  9298. }
  9299. if containerLen == 0 {
  9300. dd.ReadMapEnd()
  9301. return v, changed
  9302. }
  9303. d.depthIncr()
  9304. var mk uint64
  9305. var mv uint
  9306. hasLen := containerLen > 0
  9307. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9308. if esep {
  9309. dd.ReadMapElemKey()
  9310. }
  9311. mk = dd.DecodeUint64()
  9312. if esep {
  9313. dd.ReadMapElemValue()
  9314. }
  9315. if dd.TryDecodeAsNil() {
  9316. if v == nil {
  9317. } else if d.h.DeleteOnNilMapValue {
  9318. delete(v, mk)
  9319. } else {
  9320. v[mk] = 0
  9321. }
  9322. continue
  9323. }
  9324. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9325. if v != nil {
  9326. v[mk] = mv
  9327. }
  9328. }
  9329. dd.ReadMapEnd()
  9330. d.depthDecr()
  9331. return v, changed
  9332. }
  9333. func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  9334. if rv.Kind() == reflect.Ptr {
  9335. vp := rv2i(rv).(*map[uint64]uint8)
  9336. v, changed := fastpathTV.DecMapUint64Uint8V(*vp, true, d)
  9337. if changed {
  9338. *vp = v
  9339. }
  9340. } else {
  9341. fastpathTV.DecMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), false, d)
  9342. }
  9343. }
  9344. func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
  9345. v, changed := f.DecMapUint64Uint8V(*vp, true, d)
  9346. if changed {
  9347. *vp = v
  9348. }
  9349. }
  9350. func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, canChange bool,
  9351. d *Decoder) (_ map[uint64]uint8, changed bool) {
  9352. dd, esep := d.d, d.hh.hasElemSeparators()
  9353. containerLen := dd.ReadMapStart()
  9354. if canChange && v == nil {
  9355. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9356. v = make(map[uint64]uint8, xlen)
  9357. changed = true
  9358. }
  9359. if containerLen == 0 {
  9360. dd.ReadMapEnd()
  9361. return v, changed
  9362. }
  9363. d.depthIncr()
  9364. var mk uint64
  9365. var mv uint8
  9366. hasLen := containerLen > 0
  9367. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9368. if esep {
  9369. dd.ReadMapElemKey()
  9370. }
  9371. mk = dd.DecodeUint64()
  9372. if esep {
  9373. dd.ReadMapElemValue()
  9374. }
  9375. if dd.TryDecodeAsNil() {
  9376. if v == nil {
  9377. } else if d.h.DeleteOnNilMapValue {
  9378. delete(v, mk)
  9379. } else {
  9380. v[mk] = 0
  9381. }
  9382. continue
  9383. }
  9384. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  9385. if v != nil {
  9386. v[mk] = mv
  9387. }
  9388. }
  9389. dd.ReadMapEnd()
  9390. d.depthDecr()
  9391. return v, changed
  9392. }
  9393. func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  9394. if rv.Kind() == reflect.Ptr {
  9395. vp := rv2i(rv).(*map[uint64]uint64)
  9396. v, changed := fastpathTV.DecMapUint64Uint64V(*vp, true, d)
  9397. if changed {
  9398. *vp = v
  9399. }
  9400. } else {
  9401. fastpathTV.DecMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), false, d)
  9402. }
  9403. }
  9404. func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
  9405. v, changed := f.DecMapUint64Uint64V(*vp, true, d)
  9406. if changed {
  9407. *vp = v
  9408. }
  9409. }
  9410. func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, canChange bool,
  9411. d *Decoder) (_ map[uint64]uint64, changed bool) {
  9412. dd, esep := d.d, d.hh.hasElemSeparators()
  9413. containerLen := dd.ReadMapStart()
  9414. if canChange && v == nil {
  9415. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9416. v = make(map[uint64]uint64, xlen)
  9417. changed = true
  9418. }
  9419. if containerLen == 0 {
  9420. dd.ReadMapEnd()
  9421. return v, changed
  9422. }
  9423. d.depthIncr()
  9424. var mk uint64
  9425. var mv uint64
  9426. hasLen := containerLen > 0
  9427. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9428. if esep {
  9429. dd.ReadMapElemKey()
  9430. }
  9431. mk = dd.DecodeUint64()
  9432. if esep {
  9433. dd.ReadMapElemValue()
  9434. }
  9435. if dd.TryDecodeAsNil() {
  9436. if v == nil {
  9437. } else if d.h.DeleteOnNilMapValue {
  9438. delete(v, mk)
  9439. } else {
  9440. v[mk] = 0
  9441. }
  9442. continue
  9443. }
  9444. mv = dd.DecodeUint64()
  9445. if v != nil {
  9446. v[mk] = mv
  9447. }
  9448. }
  9449. dd.ReadMapEnd()
  9450. d.depthDecr()
  9451. return v, changed
  9452. }
  9453. func (d *Decoder) fastpathDecMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) {
  9454. if rv.Kind() == reflect.Ptr {
  9455. vp := rv2i(rv).(*map[uint64]uintptr)
  9456. v, changed := fastpathTV.DecMapUint64UintptrV(*vp, true, d)
  9457. if changed {
  9458. *vp = v
  9459. }
  9460. } else {
  9461. fastpathTV.DecMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), false, d)
  9462. }
  9463. }
  9464. func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, d *Decoder) {
  9465. v, changed := f.DecMapUint64UintptrV(*vp, true, d)
  9466. if changed {
  9467. *vp = v
  9468. }
  9469. }
  9470. func (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, canChange bool,
  9471. d *Decoder) (_ map[uint64]uintptr, changed bool) {
  9472. dd, esep := d.d, d.hh.hasElemSeparators()
  9473. containerLen := dd.ReadMapStart()
  9474. if canChange && v == nil {
  9475. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9476. v = make(map[uint64]uintptr, xlen)
  9477. changed = true
  9478. }
  9479. if containerLen == 0 {
  9480. dd.ReadMapEnd()
  9481. return v, changed
  9482. }
  9483. d.depthIncr()
  9484. var mk uint64
  9485. var mv uintptr
  9486. hasLen := containerLen > 0
  9487. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9488. if esep {
  9489. dd.ReadMapElemKey()
  9490. }
  9491. mk = dd.DecodeUint64()
  9492. if esep {
  9493. dd.ReadMapElemValue()
  9494. }
  9495. if dd.TryDecodeAsNil() {
  9496. if v == nil {
  9497. } else if d.h.DeleteOnNilMapValue {
  9498. delete(v, mk)
  9499. } else {
  9500. v[mk] = 0
  9501. }
  9502. continue
  9503. }
  9504. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9505. if v != nil {
  9506. v[mk] = mv
  9507. }
  9508. }
  9509. dd.ReadMapEnd()
  9510. d.depthDecr()
  9511. return v, changed
  9512. }
  9513. func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  9514. if rv.Kind() == reflect.Ptr {
  9515. vp := rv2i(rv).(*map[uint64]int)
  9516. v, changed := fastpathTV.DecMapUint64IntV(*vp, true, d)
  9517. if changed {
  9518. *vp = v
  9519. }
  9520. } else {
  9521. fastpathTV.DecMapUint64IntV(rv2i(rv).(map[uint64]int), false, d)
  9522. }
  9523. }
  9524. func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
  9525. v, changed := f.DecMapUint64IntV(*vp, true, d)
  9526. if changed {
  9527. *vp = v
  9528. }
  9529. }
  9530. func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, canChange bool,
  9531. d *Decoder) (_ map[uint64]int, changed bool) {
  9532. dd, esep := d.d, d.hh.hasElemSeparators()
  9533. containerLen := dd.ReadMapStart()
  9534. if canChange && v == nil {
  9535. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9536. v = make(map[uint64]int, xlen)
  9537. changed = true
  9538. }
  9539. if containerLen == 0 {
  9540. dd.ReadMapEnd()
  9541. return v, changed
  9542. }
  9543. d.depthIncr()
  9544. var mk uint64
  9545. var mv int
  9546. hasLen := containerLen > 0
  9547. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9548. if esep {
  9549. dd.ReadMapElemKey()
  9550. }
  9551. mk = dd.DecodeUint64()
  9552. if esep {
  9553. dd.ReadMapElemValue()
  9554. }
  9555. if dd.TryDecodeAsNil() {
  9556. if v == nil {
  9557. } else if d.h.DeleteOnNilMapValue {
  9558. delete(v, mk)
  9559. } else {
  9560. v[mk] = 0
  9561. }
  9562. continue
  9563. }
  9564. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  9565. if v != nil {
  9566. v[mk] = mv
  9567. }
  9568. }
  9569. dd.ReadMapEnd()
  9570. d.depthDecr()
  9571. return v, changed
  9572. }
  9573. func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  9574. if rv.Kind() == reflect.Ptr {
  9575. vp := rv2i(rv).(*map[uint64]int64)
  9576. v, changed := fastpathTV.DecMapUint64Int64V(*vp, true, d)
  9577. if changed {
  9578. *vp = v
  9579. }
  9580. } else {
  9581. fastpathTV.DecMapUint64Int64V(rv2i(rv).(map[uint64]int64), false, d)
  9582. }
  9583. }
  9584. func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) {
  9585. v, changed := f.DecMapUint64Int64V(*vp, true, d)
  9586. if changed {
  9587. *vp = v
  9588. }
  9589. }
  9590. func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, canChange bool,
  9591. d *Decoder) (_ map[uint64]int64, changed bool) {
  9592. dd, esep := d.d, d.hh.hasElemSeparators()
  9593. containerLen := dd.ReadMapStart()
  9594. if canChange && v == nil {
  9595. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9596. v = make(map[uint64]int64, xlen)
  9597. changed = true
  9598. }
  9599. if containerLen == 0 {
  9600. dd.ReadMapEnd()
  9601. return v, changed
  9602. }
  9603. d.depthIncr()
  9604. var mk uint64
  9605. var mv int64
  9606. hasLen := containerLen > 0
  9607. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9608. if esep {
  9609. dd.ReadMapElemKey()
  9610. }
  9611. mk = dd.DecodeUint64()
  9612. if esep {
  9613. dd.ReadMapElemValue()
  9614. }
  9615. if dd.TryDecodeAsNil() {
  9616. if v == nil {
  9617. } else if d.h.DeleteOnNilMapValue {
  9618. delete(v, mk)
  9619. } else {
  9620. v[mk] = 0
  9621. }
  9622. continue
  9623. }
  9624. mv = dd.DecodeInt64()
  9625. if v != nil {
  9626. v[mk] = mv
  9627. }
  9628. }
  9629. dd.ReadMapEnd()
  9630. d.depthDecr()
  9631. return v, changed
  9632. }
  9633. func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  9634. if rv.Kind() == reflect.Ptr {
  9635. vp := rv2i(rv).(*map[uint64]float32)
  9636. v, changed := fastpathTV.DecMapUint64Float32V(*vp, true, d)
  9637. if changed {
  9638. *vp = v
  9639. }
  9640. } else {
  9641. fastpathTV.DecMapUint64Float32V(rv2i(rv).(map[uint64]float32), false, d)
  9642. }
  9643. }
  9644. func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) {
  9645. v, changed := f.DecMapUint64Float32V(*vp, true, d)
  9646. if changed {
  9647. *vp = v
  9648. }
  9649. }
  9650. func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, canChange bool,
  9651. d *Decoder) (_ map[uint64]float32, changed bool) {
  9652. dd, esep := d.d, d.hh.hasElemSeparators()
  9653. containerLen := dd.ReadMapStart()
  9654. if canChange && v == nil {
  9655. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  9656. v = make(map[uint64]float32, xlen)
  9657. changed = true
  9658. }
  9659. if containerLen == 0 {
  9660. dd.ReadMapEnd()
  9661. return v, changed
  9662. }
  9663. d.depthIncr()
  9664. var mk uint64
  9665. var mv float32
  9666. hasLen := containerLen > 0
  9667. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9668. if esep {
  9669. dd.ReadMapElemKey()
  9670. }
  9671. mk = dd.DecodeUint64()
  9672. if esep {
  9673. dd.ReadMapElemValue()
  9674. }
  9675. if dd.TryDecodeAsNil() {
  9676. if v == nil {
  9677. } else if d.h.DeleteOnNilMapValue {
  9678. delete(v, mk)
  9679. } else {
  9680. v[mk] = 0
  9681. }
  9682. continue
  9683. }
  9684. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  9685. if v != nil {
  9686. v[mk] = mv
  9687. }
  9688. }
  9689. dd.ReadMapEnd()
  9690. d.depthDecr()
  9691. return v, changed
  9692. }
  9693. func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  9694. if rv.Kind() == reflect.Ptr {
  9695. vp := rv2i(rv).(*map[uint64]float64)
  9696. v, changed := fastpathTV.DecMapUint64Float64V(*vp, true, d)
  9697. if changed {
  9698. *vp = v
  9699. }
  9700. } else {
  9701. fastpathTV.DecMapUint64Float64V(rv2i(rv).(map[uint64]float64), false, d)
  9702. }
  9703. }
  9704. func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
  9705. v, changed := f.DecMapUint64Float64V(*vp, true, d)
  9706. if changed {
  9707. *vp = v
  9708. }
  9709. }
  9710. func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, canChange bool,
  9711. d *Decoder) (_ map[uint64]float64, changed bool) {
  9712. dd, esep := d.d, d.hh.hasElemSeparators()
  9713. containerLen := dd.ReadMapStart()
  9714. if canChange && v == nil {
  9715. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9716. v = make(map[uint64]float64, xlen)
  9717. changed = true
  9718. }
  9719. if containerLen == 0 {
  9720. dd.ReadMapEnd()
  9721. return v, changed
  9722. }
  9723. d.depthIncr()
  9724. var mk uint64
  9725. var mv float64
  9726. hasLen := containerLen > 0
  9727. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9728. if esep {
  9729. dd.ReadMapElemKey()
  9730. }
  9731. mk = dd.DecodeUint64()
  9732. if esep {
  9733. dd.ReadMapElemValue()
  9734. }
  9735. if dd.TryDecodeAsNil() {
  9736. if v == nil {
  9737. } else if d.h.DeleteOnNilMapValue {
  9738. delete(v, mk)
  9739. } else {
  9740. v[mk] = 0
  9741. }
  9742. continue
  9743. }
  9744. mv = dd.DecodeFloat64()
  9745. if v != nil {
  9746. v[mk] = mv
  9747. }
  9748. }
  9749. dd.ReadMapEnd()
  9750. d.depthDecr()
  9751. return v, changed
  9752. }
  9753. func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  9754. if rv.Kind() == reflect.Ptr {
  9755. vp := rv2i(rv).(*map[uint64]bool)
  9756. v, changed := fastpathTV.DecMapUint64BoolV(*vp, true, d)
  9757. if changed {
  9758. *vp = v
  9759. }
  9760. } else {
  9761. fastpathTV.DecMapUint64BoolV(rv2i(rv).(map[uint64]bool), false, d)
  9762. }
  9763. }
  9764. func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
  9765. v, changed := f.DecMapUint64BoolV(*vp, true, d)
  9766. if changed {
  9767. *vp = v
  9768. }
  9769. }
  9770. func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, canChange bool,
  9771. d *Decoder) (_ map[uint64]bool, changed bool) {
  9772. dd, esep := d.d, d.hh.hasElemSeparators()
  9773. containerLen := dd.ReadMapStart()
  9774. if canChange && v == nil {
  9775. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  9776. v = make(map[uint64]bool, xlen)
  9777. changed = true
  9778. }
  9779. if containerLen == 0 {
  9780. dd.ReadMapEnd()
  9781. return v, changed
  9782. }
  9783. d.depthIncr()
  9784. var mk uint64
  9785. var mv bool
  9786. hasLen := containerLen > 0
  9787. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9788. if esep {
  9789. dd.ReadMapElemKey()
  9790. }
  9791. mk = dd.DecodeUint64()
  9792. if esep {
  9793. dd.ReadMapElemValue()
  9794. }
  9795. if dd.TryDecodeAsNil() {
  9796. if v == nil {
  9797. } else if d.h.DeleteOnNilMapValue {
  9798. delete(v, mk)
  9799. } else {
  9800. v[mk] = false
  9801. }
  9802. continue
  9803. }
  9804. mv = dd.DecodeBool()
  9805. if v != nil {
  9806. v[mk] = mv
  9807. }
  9808. }
  9809. dd.ReadMapEnd()
  9810. d.depthDecr()
  9811. return v, changed
  9812. }
  9813. func (d *Decoder) fastpathDecMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) {
  9814. if rv.Kind() == reflect.Ptr {
  9815. vp := rv2i(rv).(*map[uintptr]interface{})
  9816. v, changed := fastpathTV.DecMapUintptrIntfV(*vp, true, d)
  9817. if changed {
  9818. *vp = v
  9819. }
  9820. } else {
  9821. fastpathTV.DecMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), false, d)
  9822. }
  9823. }
  9824. func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, d *Decoder) {
  9825. v, changed := f.DecMapUintptrIntfV(*vp, true, d)
  9826. if changed {
  9827. *vp = v
  9828. }
  9829. }
  9830. func (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, canChange bool,
  9831. d *Decoder) (_ map[uintptr]interface{}, changed bool) {
  9832. dd, esep := d.d, d.hh.hasElemSeparators()
  9833. containerLen := dd.ReadMapStart()
  9834. if canChange && v == nil {
  9835. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9836. v = make(map[uintptr]interface{}, xlen)
  9837. changed = true
  9838. }
  9839. if containerLen == 0 {
  9840. dd.ReadMapEnd()
  9841. return v, changed
  9842. }
  9843. d.depthIncr()
  9844. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  9845. var mk uintptr
  9846. var mv interface{}
  9847. hasLen := containerLen > 0
  9848. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9849. if esep {
  9850. dd.ReadMapElemKey()
  9851. }
  9852. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9853. if esep {
  9854. dd.ReadMapElemValue()
  9855. }
  9856. if dd.TryDecodeAsNil() {
  9857. if v == nil {
  9858. } else if d.h.DeleteOnNilMapValue {
  9859. delete(v, mk)
  9860. } else {
  9861. v[mk] = nil
  9862. }
  9863. continue
  9864. }
  9865. if mapGet {
  9866. mv = v[mk]
  9867. } else {
  9868. mv = nil
  9869. }
  9870. d.decode(&mv)
  9871. if v != nil {
  9872. v[mk] = mv
  9873. }
  9874. }
  9875. dd.ReadMapEnd()
  9876. d.depthDecr()
  9877. return v, changed
  9878. }
  9879. func (d *Decoder) fastpathDecMapUintptrStringR(f *codecFnInfo, rv reflect.Value) {
  9880. if rv.Kind() == reflect.Ptr {
  9881. vp := rv2i(rv).(*map[uintptr]string)
  9882. v, changed := fastpathTV.DecMapUintptrStringV(*vp, true, d)
  9883. if changed {
  9884. *vp = v
  9885. }
  9886. } else {
  9887. fastpathTV.DecMapUintptrStringV(rv2i(rv).(map[uintptr]string), false, d)
  9888. }
  9889. }
  9890. func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, d *Decoder) {
  9891. v, changed := f.DecMapUintptrStringV(*vp, true, d)
  9892. if changed {
  9893. *vp = v
  9894. }
  9895. }
  9896. func (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, canChange bool,
  9897. d *Decoder) (_ map[uintptr]string, changed bool) {
  9898. dd, esep := d.d, d.hh.hasElemSeparators()
  9899. containerLen := dd.ReadMapStart()
  9900. if canChange && v == nil {
  9901. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  9902. v = make(map[uintptr]string, xlen)
  9903. changed = true
  9904. }
  9905. if containerLen == 0 {
  9906. dd.ReadMapEnd()
  9907. return v, changed
  9908. }
  9909. d.depthIncr()
  9910. var mk uintptr
  9911. var mv string
  9912. hasLen := containerLen > 0
  9913. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9914. if esep {
  9915. dd.ReadMapElemKey()
  9916. }
  9917. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9918. if esep {
  9919. dd.ReadMapElemValue()
  9920. }
  9921. if dd.TryDecodeAsNil() {
  9922. if v == nil {
  9923. } else if d.h.DeleteOnNilMapValue {
  9924. delete(v, mk)
  9925. } else {
  9926. v[mk] = ""
  9927. }
  9928. continue
  9929. }
  9930. mv = dd.DecodeString()
  9931. if v != nil {
  9932. v[mk] = mv
  9933. }
  9934. }
  9935. dd.ReadMapEnd()
  9936. d.depthDecr()
  9937. return v, changed
  9938. }
  9939. func (d *Decoder) fastpathDecMapUintptrUintR(f *codecFnInfo, rv reflect.Value) {
  9940. if rv.Kind() == reflect.Ptr {
  9941. vp := rv2i(rv).(*map[uintptr]uint)
  9942. v, changed := fastpathTV.DecMapUintptrUintV(*vp, true, d)
  9943. if changed {
  9944. *vp = v
  9945. }
  9946. } else {
  9947. fastpathTV.DecMapUintptrUintV(rv2i(rv).(map[uintptr]uint), false, d)
  9948. }
  9949. }
  9950. func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, d *Decoder) {
  9951. v, changed := f.DecMapUintptrUintV(*vp, true, d)
  9952. if changed {
  9953. *vp = v
  9954. }
  9955. }
  9956. func (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, canChange bool,
  9957. d *Decoder) (_ map[uintptr]uint, changed bool) {
  9958. dd, esep := d.d, d.hh.hasElemSeparators()
  9959. containerLen := dd.ReadMapStart()
  9960. if canChange && v == nil {
  9961. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  9962. v = make(map[uintptr]uint, xlen)
  9963. changed = true
  9964. }
  9965. if containerLen == 0 {
  9966. dd.ReadMapEnd()
  9967. return v, changed
  9968. }
  9969. d.depthIncr()
  9970. var mk uintptr
  9971. var mv uint
  9972. hasLen := containerLen > 0
  9973. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  9974. if esep {
  9975. dd.ReadMapElemKey()
  9976. }
  9977. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9978. if esep {
  9979. dd.ReadMapElemValue()
  9980. }
  9981. if dd.TryDecodeAsNil() {
  9982. if v == nil {
  9983. } else if d.h.DeleteOnNilMapValue {
  9984. delete(v, mk)
  9985. } else {
  9986. v[mk] = 0
  9987. }
  9988. continue
  9989. }
  9990. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  9991. if v != nil {
  9992. v[mk] = mv
  9993. }
  9994. }
  9995. dd.ReadMapEnd()
  9996. d.depthDecr()
  9997. return v, changed
  9998. }
  9999. func (d *Decoder) fastpathDecMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) {
  10000. if rv.Kind() == reflect.Ptr {
  10001. vp := rv2i(rv).(*map[uintptr]uint8)
  10002. v, changed := fastpathTV.DecMapUintptrUint8V(*vp, true, d)
  10003. if changed {
  10004. *vp = v
  10005. }
  10006. } else {
  10007. fastpathTV.DecMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), false, d)
  10008. }
  10009. }
  10010. func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, d *Decoder) {
  10011. v, changed := f.DecMapUintptrUint8V(*vp, true, d)
  10012. if changed {
  10013. *vp = v
  10014. }
  10015. }
  10016. func (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, canChange bool,
  10017. d *Decoder) (_ map[uintptr]uint8, changed bool) {
  10018. dd, esep := d.d, d.hh.hasElemSeparators()
  10019. containerLen := dd.ReadMapStart()
  10020. if canChange && v == nil {
  10021. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10022. v = make(map[uintptr]uint8, xlen)
  10023. changed = true
  10024. }
  10025. if containerLen == 0 {
  10026. dd.ReadMapEnd()
  10027. return v, changed
  10028. }
  10029. d.depthIncr()
  10030. var mk uintptr
  10031. var mv uint8
  10032. hasLen := containerLen > 0
  10033. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10034. if esep {
  10035. dd.ReadMapElemKey()
  10036. }
  10037. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10038. if esep {
  10039. dd.ReadMapElemValue()
  10040. }
  10041. if dd.TryDecodeAsNil() {
  10042. if v == nil {
  10043. } else if d.h.DeleteOnNilMapValue {
  10044. delete(v, mk)
  10045. } else {
  10046. v[mk] = 0
  10047. }
  10048. continue
  10049. }
  10050. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  10051. if v != nil {
  10052. v[mk] = mv
  10053. }
  10054. }
  10055. dd.ReadMapEnd()
  10056. d.depthDecr()
  10057. return v, changed
  10058. }
  10059. func (d *Decoder) fastpathDecMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) {
  10060. if rv.Kind() == reflect.Ptr {
  10061. vp := rv2i(rv).(*map[uintptr]uint64)
  10062. v, changed := fastpathTV.DecMapUintptrUint64V(*vp, true, d)
  10063. if changed {
  10064. *vp = v
  10065. }
  10066. } else {
  10067. fastpathTV.DecMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), false, d)
  10068. }
  10069. }
  10070. func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, d *Decoder) {
  10071. v, changed := f.DecMapUintptrUint64V(*vp, true, d)
  10072. if changed {
  10073. *vp = v
  10074. }
  10075. }
  10076. func (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, canChange bool,
  10077. d *Decoder) (_ map[uintptr]uint64, changed bool) {
  10078. dd, esep := d.d, d.hh.hasElemSeparators()
  10079. containerLen := dd.ReadMapStart()
  10080. if canChange && v == nil {
  10081. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10082. v = make(map[uintptr]uint64, xlen)
  10083. changed = true
  10084. }
  10085. if containerLen == 0 {
  10086. dd.ReadMapEnd()
  10087. return v, changed
  10088. }
  10089. d.depthIncr()
  10090. var mk uintptr
  10091. var mv uint64
  10092. hasLen := containerLen > 0
  10093. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10094. if esep {
  10095. dd.ReadMapElemKey()
  10096. }
  10097. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10098. if esep {
  10099. dd.ReadMapElemValue()
  10100. }
  10101. if dd.TryDecodeAsNil() {
  10102. if v == nil {
  10103. } else if d.h.DeleteOnNilMapValue {
  10104. delete(v, mk)
  10105. } else {
  10106. v[mk] = 0
  10107. }
  10108. continue
  10109. }
  10110. mv = dd.DecodeUint64()
  10111. if v != nil {
  10112. v[mk] = mv
  10113. }
  10114. }
  10115. dd.ReadMapEnd()
  10116. d.depthDecr()
  10117. return v, changed
  10118. }
  10119. func (d *Decoder) fastpathDecMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) {
  10120. if rv.Kind() == reflect.Ptr {
  10121. vp := rv2i(rv).(*map[uintptr]uintptr)
  10122. v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, true, d)
  10123. if changed {
  10124. *vp = v
  10125. }
  10126. } else {
  10127. fastpathTV.DecMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), false, d)
  10128. }
  10129. }
  10130. func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, d *Decoder) {
  10131. v, changed := f.DecMapUintptrUintptrV(*vp, true, d)
  10132. if changed {
  10133. *vp = v
  10134. }
  10135. }
  10136. func (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, canChange bool,
  10137. d *Decoder) (_ map[uintptr]uintptr, changed bool) {
  10138. dd, esep := d.d, d.hh.hasElemSeparators()
  10139. containerLen := dd.ReadMapStart()
  10140. if canChange && v == nil {
  10141. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10142. v = make(map[uintptr]uintptr, xlen)
  10143. changed = true
  10144. }
  10145. if containerLen == 0 {
  10146. dd.ReadMapEnd()
  10147. return v, changed
  10148. }
  10149. d.depthIncr()
  10150. var mk uintptr
  10151. var mv uintptr
  10152. hasLen := containerLen > 0
  10153. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10154. if esep {
  10155. dd.ReadMapElemKey()
  10156. }
  10157. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10158. if esep {
  10159. dd.ReadMapElemValue()
  10160. }
  10161. if dd.TryDecodeAsNil() {
  10162. if v == nil {
  10163. } else if d.h.DeleteOnNilMapValue {
  10164. delete(v, mk)
  10165. } else {
  10166. v[mk] = 0
  10167. }
  10168. continue
  10169. }
  10170. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10171. if v != nil {
  10172. v[mk] = mv
  10173. }
  10174. }
  10175. dd.ReadMapEnd()
  10176. d.depthDecr()
  10177. return v, changed
  10178. }
  10179. func (d *Decoder) fastpathDecMapUintptrIntR(f *codecFnInfo, rv reflect.Value) {
  10180. if rv.Kind() == reflect.Ptr {
  10181. vp := rv2i(rv).(*map[uintptr]int)
  10182. v, changed := fastpathTV.DecMapUintptrIntV(*vp, true, d)
  10183. if changed {
  10184. *vp = v
  10185. }
  10186. } else {
  10187. fastpathTV.DecMapUintptrIntV(rv2i(rv).(map[uintptr]int), false, d)
  10188. }
  10189. }
  10190. func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, d *Decoder) {
  10191. v, changed := f.DecMapUintptrIntV(*vp, true, d)
  10192. if changed {
  10193. *vp = v
  10194. }
  10195. }
  10196. func (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, canChange bool,
  10197. d *Decoder) (_ map[uintptr]int, changed bool) {
  10198. dd, esep := d.d, d.hh.hasElemSeparators()
  10199. containerLen := dd.ReadMapStart()
  10200. if canChange && v == nil {
  10201. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10202. v = make(map[uintptr]int, xlen)
  10203. changed = true
  10204. }
  10205. if containerLen == 0 {
  10206. dd.ReadMapEnd()
  10207. return v, changed
  10208. }
  10209. d.depthIncr()
  10210. var mk uintptr
  10211. var mv int
  10212. hasLen := containerLen > 0
  10213. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10214. if esep {
  10215. dd.ReadMapElemKey()
  10216. }
  10217. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10218. if esep {
  10219. dd.ReadMapElemValue()
  10220. }
  10221. if dd.TryDecodeAsNil() {
  10222. if v == nil {
  10223. } else if d.h.DeleteOnNilMapValue {
  10224. delete(v, mk)
  10225. } else {
  10226. v[mk] = 0
  10227. }
  10228. continue
  10229. }
  10230. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10231. if v != nil {
  10232. v[mk] = mv
  10233. }
  10234. }
  10235. dd.ReadMapEnd()
  10236. d.depthDecr()
  10237. return v, changed
  10238. }
  10239. func (d *Decoder) fastpathDecMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) {
  10240. if rv.Kind() == reflect.Ptr {
  10241. vp := rv2i(rv).(*map[uintptr]int64)
  10242. v, changed := fastpathTV.DecMapUintptrInt64V(*vp, true, d)
  10243. if changed {
  10244. *vp = v
  10245. }
  10246. } else {
  10247. fastpathTV.DecMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), false, d)
  10248. }
  10249. }
  10250. func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, d *Decoder) {
  10251. v, changed := f.DecMapUintptrInt64V(*vp, true, d)
  10252. if changed {
  10253. *vp = v
  10254. }
  10255. }
  10256. func (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, canChange bool,
  10257. d *Decoder) (_ map[uintptr]int64, changed bool) {
  10258. dd, esep := d.d, d.hh.hasElemSeparators()
  10259. containerLen := dd.ReadMapStart()
  10260. if canChange && v == nil {
  10261. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10262. v = make(map[uintptr]int64, xlen)
  10263. changed = true
  10264. }
  10265. if containerLen == 0 {
  10266. dd.ReadMapEnd()
  10267. return v, changed
  10268. }
  10269. d.depthIncr()
  10270. var mk uintptr
  10271. var mv int64
  10272. hasLen := containerLen > 0
  10273. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10274. if esep {
  10275. dd.ReadMapElemKey()
  10276. }
  10277. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10278. if esep {
  10279. dd.ReadMapElemValue()
  10280. }
  10281. if dd.TryDecodeAsNil() {
  10282. if v == nil {
  10283. } else if d.h.DeleteOnNilMapValue {
  10284. delete(v, mk)
  10285. } else {
  10286. v[mk] = 0
  10287. }
  10288. continue
  10289. }
  10290. mv = dd.DecodeInt64()
  10291. if v != nil {
  10292. v[mk] = mv
  10293. }
  10294. }
  10295. dd.ReadMapEnd()
  10296. d.depthDecr()
  10297. return v, changed
  10298. }
  10299. func (d *Decoder) fastpathDecMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) {
  10300. if rv.Kind() == reflect.Ptr {
  10301. vp := rv2i(rv).(*map[uintptr]float32)
  10302. v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, true, d)
  10303. if changed {
  10304. *vp = v
  10305. }
  10306. } else {
  10307. fastpathTV.DecMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), false, d)
  10308. }
  10309. }
  10310. func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, d *Decoder) {
  10311. v, changed := f.DecMapUintptrFloat32V(*vp, true, d)
  10312. if changed {
  10313. *vp = v
  10314. }
  10315. }
  10316. func (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, canChange bool,
  10317. d *Decoder) (_ map[uintptr]float32, changed bool) {
  10318. dd, esep := d.d, d.hh.hasElemSeparators()
  10319. containerLen := dd.ReadMapStart()
  10320. if canChange && v == nil {
  10321. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  10322. v = make(map[uintptr]float32, xlen)
  10323. changed = true
  10324. }
  10325. if containerLen == 0 {
  10326. dd.ReadMapEnd()
  10327. return v, changed
  10328. }
  10329. d.depthIncr()
  10330. var mk uintptr
  10331. var mv float32
  10332. hasLen := containerLen > 0
  10333. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10334. if esep {
  10335. dd.ReadMapElemKey()
  10336. }
  10337. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10338. if esep {
  10339. dd.ReadMapElemValue()
  10340. }
  10341. if dd.TryDecodeAsNil() {
  10342. if v == nil {
  10343. } else if d.h.DeleteOnNilMapValue {
  10344. delete(v, mk)
  10345. } else {
  10346. v[mk] = 0
  10347. }
  10348. continue
  10349. }
  10350. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  10351. if v != nil {
  10352. v[mk] = mv
  10353. }
  10354. }
  10355. dd.ReadMapEnd()
  10356. d.depthDecr()
  10357. return v, changed
  10358. }
  10359. func (d *Decoder) fastpathDecMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) {
  10360. if rv.Kind() == reflect.Ptr {
  10361. vp := rv2i(rv).(*map[uintptr]float64)
  10362. v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, true, d)
  10363. if changed {
  10364. *vp = v
  10365. }
  10366. } else {
  10367. fastpathTV.DecMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), false, d)
  10368. }
  10369. }
  10370. func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, d *Decoder) {
  10371. v, changed := f.DecMapUintptrFloat64V(*vp, true, d)
  10372. if changed {
  10373. *vp = v
  10374. }
  10375. }
  10376. func (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, canChange bool,
  10377. d *Decoder) (_ map[uintptr]float64, changed bool) {
  10378. dd, esep := d.d, d.hh.hasElemSeparators()
  10379. containerLen := dd.ReadMapStart()
  10380. if canChange && v == nil {
  10381. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10382. v = make(map[uintptr]float64, xlen)
  10383. changed = true
  10384. }
  10385. if containerLen == 0 {
  10386. dd.ReadMapEnd()
  10387. return v, changed
  10388. }
  10389. d.depthIncr()
  10390. var mk uintptr
  10391. var mv float64
  10392. hasLen := containerLen > 0
  10393. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10394. if esep {
  10395. dd.ReadMapElemKey()
  10396. }
  10397. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10398. if esep {
  10399. dd.ReadMapElemValue()
  10400. }
  10401. if dd.TryDecodeAsNil() {
  10402. if v == nil {
  10403. } else if d.h.DeleteOnNilMapValue {
  10404. delete(v, mk)
  10405. } else {
  10406. v[mk] = 0
  10407. }
  10408. continue
  10409. }
  10410. mv = dd.DecodeFloat64()
  10411. if v != nil {
  10412. v[mk] = mv
  10413. }
  10414. }
  10415. dd.ReadMapEnd()
  10416. d.depthDecr()
  10417. return v, changed
  10418. }
  10419. func (d *Decoder) fastpathDecMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) {
  10420. if rv.Kind() == reflect.Ptr {
  10421. vp := rv2i(rv).(*map[uintptr]bool)
  10422. v, changed := fastpathTV.DecMapUintptrBoolV(*vp, true, d)
  10423. if changed {
  10424. *vp = v
  10425. }
  10426. } else {
  10427. fastpathTV.DecMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), false, d)
  10428. }
  10429. }
  10430. func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, d *Decoder) {
  10431. v, changed := f.DecMapUintptrBoolV(*vp, true, d)
  10432. if changed {
  10433. *vp = v
  10434. }
  10435. }
  10436. func (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, canChange bool,
  10437. d *Decoder) (_ map[uintptr]bool, changed bool) {
  10438. dd, esep := d.d, d.hh.hasElemSeparators()
  10439. containerLen := dd.ReadMapStart()
  10440. if canChange && v == nil {
  10441. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10442. v = make(map[uintptr]bool, xlen)
  10443. changed = true
  10444. }
  10445. if containerLen == 0 {
  10446. dd.ReadMapEnd()
  10447. return v, changed
  10448. }
  10449. d.depthIncr()
  10450. var mk uintptr
  10451. var mv bool
  10452. hasLen := containerLen > 0
  10453. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10454. if esep {
  10455. dd.ReadMapElemKey()
  10456. }
  10457. mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10458. if esep {
  10459. dd.ReadMapElemValue()
  10460. }
  10461. if dd.TryDecodeAsNil() {
  10462. if v == nil {
  10463. } else if d.h.DeleteOnNilMapValue {
  10464. delete(v, mk)
  10465. } else {
  10466. v[mk] = false
  10467. }
  10468. continue
  10469. }
  10470. mv = dd.DecodeBool()
  10471. if v != nil {
  10472. v[mk] = mv
  10473. }
  10474. }
  10475. dd.ReadMapEnd()
  10476. d.depthDecr()
  10477. return v, changed
  10478. }
  10479. func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  10480. if rv.Kind() == reflect.Ptr {
  10481. vp := rv2i(rv).(*map[int]interface{})
  10482. v, changed := fastpathTV.DecMapIntIntfV(*vp, true, d)
  10483. if changed {
  10484. *vp = v
  10485. }
  10486. } else {
  10487. fastpathTV.DecMapIntIntfV(rv2i(rv).(map[int]interface{}), false, d)
  10488. }
  10489. }
  10490. func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
  10491. v, changed := f.DecMapIntIntfV(*vp, true, d)
  10492. if changed {
  10493. *vp = v
  10494. }
  10495. }
  10496. func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, canChange bool,
  10497. d *Decoder) (_ map[int]interface{}, changed bool) {
  10498. dd, esep := d.d, d.hh.hasElemSeparators()
  10499. containerLen := dd.ReadMapStart()
  10500. if canChange && v == nil {
  10501. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  10502. v = make(map[int]interface{}, xlen)
  10503. changed = true
  10504. }
  10505. if containerLen == 0 {
  10506. dd.ReadMapEnd()
  10507. return v, changed
  10508. }
  10509. d.depthIncr()
  10510. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  10511. var mk int
  10512. var mv interface{}
  10513. hasLen := containerLen > 0
  10514. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10515. if esep {
  10516. dd.ReadMapElemKey()
  10517. }
  10518. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10519. if esep {
  10520. dd.ReadMapElemValue()
  10521. }
  10522. if dd.TryDecodeAsNil() {
  10523. if v == nil {
  10524. } else if d.h.DeleteOnNilMapValue {
  10525. delete(v, mk)
  10526. } else {
  10527. v[mk] = nil
  10528. }
  10529. continue
  10530. }
  10531. if mapGet {
  10532. mv = v[mk]
  10533. } else {
  10534. mv = nil
  10535. }
  10536. d.decode(&mv)
  10537. if v != nil {
  10538. v[mk] = mv
  10539. }
  10540. }
  10541. dd.ReadMapEnd()
  10542. d.depthDecr()
  10543. return v, changed
  10544. }
  10545. func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  10546. if rv.Kind() == reflect.Ptr {
  10547. vp := rv2i(rv).(*map[int]string)
  10548. v, changed := fastpathTV.DecMapIntStringV(*vp, true, d)
  10549. if changed {
  10550. *vp = v
  10551. }
  10552. } else {
  10553. fastpathTV.DecMapIntStringV(rv2i(rv).(map[int]string), false, d)
  10554. }
  10555. }
  10556. func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
  10557. v, changed := f.DecMapIntStringV(*vp, true, d)
  10558. if changed {
  10559. *vp = v
  10560. }
  10561. }
  10562. func (_ fastpathT) DecMapIntStringV(v map[int]string, canChange bool,
  10563. d *Decoder) (_ map[int]string, changed bool) {
  10564. dd, esep := d.d, d.hh.hasElemSeparators()
  10565. containerLen := dd.ReadMapStart()
  10566. if canChange && v == nil {
  10567. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  10568. v = make(map[int]string, xlen)
  10569. changed = true
  10570. }
  10571. if containerLen == 0 {
  10572. dd.ReadMapEnd()
  10573. return v, changed
  10574. }
  10575. d.depthIncr()
  10576. var mk int
  10577. var mv string
  10578. hasLen := containerLen > 0
  10579. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10580. if esep {
  10581. dd.ReadMapElemKey()
  10582. }
  10583. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10584. if esep {
  10585. dd.ReadMapElemValue()
  10586. }
  10587. if dd.TryDecodeAsNil() {
  10588. if v == nil {
  10589. } else if d.h.DeleteOnNilMapValue {
  10590. delete(v, mk)
  10591. } else {
  10592. v[mk] = ""
  10593. }
  10594. continue
  10595. }
  10596. mv = dd.DecodeString()
  10597. if v != nil {
  10598. v[mk] = mv
  10599. }
  10600. }
  10601. dd.ReadMapEnd()
  10602. d.depthDecr()
  10603. return v, changed
  10604. }
  10605. func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  10606. if rv.Kind() == reflect.Ptr {
  10607. vp := rv2i(rv).(*map[int]uint)
  10608. v, changed := fastpathTV.DecMapIntUintV(*vp, true, d)
  10609. if changed {
  10610. *vp = v
  10611. }
  10612. } else {
  10613. fastpathTV.DecMapIntUintV(rv2i(rv).(map[int]uint), false, d)
  10614. }
  10615. }
  10616. func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) {
  10617. v, changed := f.DecMapIntUintV(*vp, true, d)
  10618. if changed {
  10619. *vp = v
  10620. }
  10621. }
  10622. func (_ fastpathT) DecMapIntUintV(v map[int]uint, canChange bool,
  10623. d *Decoder) (_ map[int]uint, changed bool) {
  10624. dd, esep := d.d, d.hh.hasElemSeparators()
  10625. containerLen := dd.ReadMapStart()
  10626. if canChange && v == nil {
  10627. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10628. v = make(map[int]uint, xlen)
  10629. changed = true
  10630. }
  10631. if containerLen == 0 {
  10632. dd.ReadMapEnd()
  10633. return v, changed
  10634. }
  10635. d.depthIncr()
  10636. var mk int
  10637. var mv uint
  10638. hasLen := containerLen > 0
  10639. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10640. if esep {
  10641. dd.ReadMapElemKey()
  10642. }
  10643. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10644. if esep {
  10645. dd.ReadMapElemValue()
  10646. }
  10647. if dd.TryDecodeAsNil() {
  10648. if v == nil {
  10649. } else if d.h.DeleteOnNilMapValue {
  10650. delete(v, mk)
  10651. } else {
  10652. v[mk] = 0
  10653. }
  10654. continue
  10655. }
  10656. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10657. if v != nil {
  10658. v[mk] = mv
  10659. }
  10660. }
  10661. dd.ReadMapEnd()
  10662. d.depthDecr()
  10663. return v, changed
  10664. }
  10665. func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  10666. if rv.Kind() == reflect.Ptr {
  10667. vp := rv2i(rv).(*map[int]uint8)
  10668. v, changed := fastpathTV.DecMapIntUint8V(*vp, true, d)
  10669. if changed {
  10670. *vp = v
  10671. }
  10672. } else {
  10673. fastpathTV.DecMapIntUint8V(rv2i(rv).(map[int]uint8), false, d)
  10674. }
  10675. }
  10676. func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
  10677. v, changed := f.DecMapIntUint8V(*vp, true, d)
  10678. if changed {
  10679. *vp = v
  10680. }
  10681. }
  10682. func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, canChange bool,
  10683. d *Decoder) (_ map[int]uint8, changed bool) {
  10684. dd, esep := d.d, d.hh.hasElemSeparators()
  10685. containerLen := dd.ReadMapStart()
  10686. if canChange && v == nil {
  10687. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  10688. v = make(map[int]uint8, xlen)
  10689. changed = true
  10690. }
  10691. if containerLen == 0 {
  10692. dd.ReadMapEnd()
  10693. return v, changed
  10694. }
  10695. d.depthIncr()
  10696. var mk int
  10697. var mv uint8
  10698. hasLen := containerLen > 0
  10699. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10700. if esep {
  10701. dd.ReadMapElemKey()
  10702. }
  10703. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10704. if esep {
  10705. dd.ReadMapElemValue()
  10706. }
  10707. if dd.TryDecodeAsNil() {
  10708. if v == nil {
  10709. } else if d.h.DeleteOnNilMapValue {
  10710. delete(v, mk)
  10711. } else {
  10712. v[mk] = 0
  10713. }
  10714. continue
  10715. }
  10716. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  10717. if v != nil {
  10718. v[mk] = mv
  10719. }
  10720. }
  10721. dd.ReadMapEnd()
  10722. d.depthDecr()
  10723. return v, changed
  10724. }
  10725. func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  10726. if rv.Kind() == reflect.Ptr {
  10727. vp := rv2i(rv).(*map[int]uint64)
  10728. v, changed := fastpathTV.DecMapIntUint64V(*vp, true, d)
  10729. if changed {
  10730. *vp = v
  10731. }
  10732. } else {
  10733. fastpathTV.DecMapIntUint64V(rv2i(rv).(map[int]uint64), false, d)
  10734. }
  10735. }
  10736. func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
  10737. v, changed := f.DecMapIntUint64V(*vp, true, d)
  10738. if changed {
  10739. *vp = v
  10740. }
  10741. }
  10742. func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, canChange bool,
  10743. d *Decoder) (_ map[int]uint64, changed bool) {
  10744. dd, esep := d.d, d.hh.hasElemSeparators()
  10745. containerLen := dd.ReadMapStart()
  10746. if canChange && v == nil {
  10747. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10748. v = make(map[int]uint64, xlen)
  10749. changed = true
  10750. }
  10751. if containerLen == 0 {
  10752. dd.ReadMapEnd()
  10753. return v, changed
  10754. }
  10755. d.depthIncr()
  10756. var mk int
  10757. var mv uint64
  10758. hasLen := containerLen > 0
  10759. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10760. if esep {
  10761. dd.ReadMapElemKey()
  10762. }
  10763. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10764. if esep {
  10765. dd.ReadMapElemValue()
  10766. }
  10767. if dd.TryDecodeAsNil() {
  10768. if v == nil {
  10769. } else if d.h.DeleteOnNilMapValue {
  10770. delete(v, mk)
  10771. } else {
  10772. v[mk] = 0
  10773. }
  10774. continue
  10775. }
  10776. mv = dd.DecodeUint64()
  10777. if v != nil {
  10778. v[mk] = mv
  10779. }
  10780. }
  10781. dd.ReadMapEnd()
  10782. d.depthDecr()
  10783. return v, changed
  10784. }
  10785. func (d *Decoder) fastpathDecMapIntUintptrR(f *codecFnInfo, rv reflect.Value) {
  10786. if rv.Kind() == reflect.Ptr {
  10787. vp := rv2i(rv).(*map[int]uintptr)
  10788. v, changed := fastpathTV.DecMapIntUintptrV(*vp, true, d)
  10789. if changed {
  10790. *vp = v
  10791. }
  10792. } else {
  10793. fastpathTV.DecMapIntUintptrV(rv2i(rv).(map[int]uintptr), false, d)
  10794. }
  10795. }
  10796. func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, d *Decoder) {
  10797. v, changed := f.DecMapIntUintptrV(*vp, true, d)
  10798. if changed {
  10799. *vp = v
  10800. }
  10801. }
  10802. func (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, canChange bool,
  10803. d *Decoder) (_ map[int]uintptr, changed bool) {
  10804. dd, esep := d.d, d.hh.hasElemSeparators()
  10805. containerLen := dd.ReadMapStart()
  10806. if canChange && v == nil {
  10807. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10808. v = make(map[int]uintptr, xlen)
  10809. changed = true
  10810. }
  10811. if containerLen == 0 {
  10812. dd.ReadMapEnd()
  10813. return v, changed
  10814. }
  10815. d.depthIncr()
  10816. var mk int
  10817. var mv uintptr
  10818. hasLen := containerLen > 0
  10819. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10820. if esep {
  10821. dd.ReadMapElemKey()
  10822. }
  10823. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10824. if esep {
  10825. dd.ReadMapElemValue()
  10826. }
  10827. if dd.TryDecodeAsNil() {
  10828. if v == nil {
  10829. } else if d.h.DeleteOnNilMapValue {
  10830. delete(v, mk)
  10831. } else {
  10832. v[mk] = 0
  10833. }
  10834. continue
  10835. }
  10836. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  10837. if v != nil {
  10838. v[mk] = mv
  10839. }
  10840. }
  10841. dd.ReadMapEnd()
  10842. d.depthDecr()
  10843. return v, changed
  10844. }
  10845. func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  10846. if rv.Kind() == reflect.Ptr {
  10847. vp := rv2i(rv).(*map[int]int)
  10848. v, changed := fastpathTV.DecMapIntIntV(*vp, true, d)
  10849. if changed {
  10850. *vp = v
  10851. }
  10852. } else {
  10853. fastpathTV.DecMapIntIntV(rv2i(rv).(map[int]int), false, d)
  10854. }
  10855. }
  10856. func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
  10857. v, changed := f.DecMapIntIntV(*vp, true, d)
  10858. if changed {
  10859. *vp = v
  10860. }
  10861. }
  10862. func (_ fastpathT) DecMapIntIntV(v map[int]int, canChange bool,
  10863. d *Decoder) (_ map[int]int, changed bool) {
  10864. dd, esep := d.d, d.hh.hasElemSeparators()
  10865. containerLen := dd.ReadMapStart()
  10866. if canChange && v == nil {
  10867. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10868. v = make(map[int]int, xlen)
  10869. changed = true
  10870. }
  10871. if containerLen == 0 {
  10872. dd.ReadMapEnd()
  10873. return v, changed
  10874. }
  10875. d.depthIncr()
  10876. var mk int
  10877. var mv int
  10878. hasLen := containerLen > 0
  10879. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10880. if esep {
  10881. dd.ReadMapElemKey()
  10882. }
  10883. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10884. if esep {
  10885. dd.ReadMapElemValue()
  10886. }
  10887. if dd.TryDecodeAsNil() {
  10888. if v == nil {
  10889. } else if d.h.DeleteOnNilMapValue {
  10890. delete(v, mk)
  10891. } else {
  10892. v[mk] = 0
  10893. }
  10894. continue
  10895. }
  10896. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10897. if v != nil {
  10898. v[mk] = mv
  10899. }
  10900. }
  10901. dd.ReadMapEnd()
  10902. d.depthDecr()
  10903. return v, changed
  10904. }
  10905. func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  10906. if rv.Kind() == reflect.Ptr {
  10907. vp := rv2i(rv).(*map[int]int64)
  10908. v, changed := fastpathTV.DecMapIntInt64V(*vp, true, d)
  10909. if changed {
  10910. *vp = v
  10911. }
  10912. } else {
  10913. fastpathTV.DecMapIntInt64V(rv2i(rv).(map[int]int64), false, d)
  10914. }
  10915. }
  10916. func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) {
  10917. v, changed := f.DecMapIntInt64V(*vp, true, d)
  10918. if changed {
  10919. *vp = v
  10920. }
  10921. }
  10922. func (_ fastpathT) DecMapIntInt64V(v map[int]int64, canChange bool,
  10923. d *Decoder) (_ map[int]int64, changed bool) {
  10924. dd, esep := d.d, d.hh.hasElemSeparators()
  10925. containerLen := dd.ReadMapStart()
  10926. if canChange && v == nil {
  10927. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  10928. v = make(map[int]int64, xlen)
  10929. changed = true
  10930. }
  10931. if containerLen == 0 {
  10932. dd.ReadMapEnd()
  10933. return v, changed
  10934. }
  10935. d.depthIncr()
  10936. var mk int
  10937. var mv int64
  10938. hasLen := containerLen > 0
  10939. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  10940. if esep {
  10941. dd.ReadMapElemKey()
  10942. }
  10943. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  10944. if esep {
  10945. dd.ReadMapElemValue()
  10946. }
  10947. if dd.TryDecodeAsNil() {
  10948. if v == nil {
  10949. } else if d.h.DeleteOnNilMapValue {
  10950. delete(v, mk)
  10951. } else {
  10952. v[mk] = 0
  10953. }
  10954. continue
  10955. }
  10956. mv = dd.DecodeInt64()
  10957. if v != nil {
  10958. v[mk] = mv
  10959. }
  10960. }
  10961. dd.ReadMapEnd()
  10962. d.depthDecr()
  10963. return v, changed
  10964. }
  10965. func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  10966. if rv.Kind() == reflect.Ptr {
  10967. vp := rv2i(rv).(*map[int]float32)
  10968. v, changed := fastpathTV.DecMapIntFloat32V(*vp, true, d)
  10969. if changed {
  10970. *vp = v
  10971. }
  10972. } else {
  10973. fastpathTV.DecMapIntFloat32V(rv2i(rv).(map[int]float32), false, d)
  10974. }
  10975. }
  10976. func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) {
  10977. v, changed := f.DecMapIntFloat32V(*vp, true, d)
  10978. if changed {
  10979. *vp = v
  10980. }
  10981. }
  10982. func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, canChange bool,
  10983. d *Decoder) (_ map[int]float32, changed bool) {
  10984. dd, esep := d.d, d.hh.hasElemSeparators()
  10985. containerLen := dd.ReadMapStart()
  10986. if canChange && v == nil {
  10987. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  10988. v = make(map[int]float32, xlen)
  10989. changed = true
  10990. }
  10991. if containerLen == 0 {
  10992. dd.ReadMapEnd()
  10993. return v, changed
  10994. }
  10995. d.depthIncr()
  10996. var mk int
  10997. var mv float32
  10998. hasLen := containerLen > 0
  10999. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11000. if esep {
  11001. dd.ReadMapElemKey()
  11002. }
  11003. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  11004. if esep {
  11005. dd.ReadMapElemValue()
  11006. }
  11007. if dd.TryDecodeAsNil() {
  11008. if v == nil {
  11009. } else if d.h.DeleteOnNilMapValue {
  11010. delete(v, mk)
  11011. } else {
  11012. v[mk] = 0
  11013. }
  11014. continue
  11015. }
  11016. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  11017. if v != nil {
  11018. v[mk] = mv
  11019. }
  11020. }
  11021. dd.ReadMapEnd()
  11022. d.depthDecr()
  11023. return v, changed
  11024. }
  11025. func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  11026. if rv.Kind() == reflect.Ptr {
  11027. vp := rv2i(rv).(*map[int]float64)
  11028. v, changed := fastpathTV.DecMapIntFloat64V(*vp, true, d)
  11029. if changed {
  11030. *vp = v
  11031. }
  11032. } else {
  11033. fastpathTV.DecMapIntFloat64V(rv2i(rv).(map[int]float64), false, d)
  11034. }
  11035. }
  11036. func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
  11037. v, changed := f.DecMapIntFloat64V(*vp, true, d)
  11038. if changed {
  11039. *vp = v
  11040. }
  11041. }
  11042. func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, canChange bool,
  11043. d *Decoder) (_ map[int]float64, changed bool) {
  11044. dd, esep := d.d, d.hh.hasElemSeparators()
  11045. containerLen := dd.ReadMapStart()
  11046. if canChange && v == nil {
  11047. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11048. v = make(map[int]float64, xlen)
  11049. changed = true
  11050. }
  11051. if containerLen == 0 {
  11052. dd.ReadMapEnd()
  11053. return v, changed
  11054. }
  11055. d.depthIncr()
  11056. var mk int
  11057. var mv float64
  11058. hasLen := containerLen > 0
  11059. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11060. if esep {
  11061. dd.ReadMapElemKey()
  11062. }
  11063. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  11064. if esep {
  11065. dd.ReadMapElemValue()
  11066. }
  11067. if dd.TryDecodeAsNil() {
  11068. if v == nil {
  11069. } else if d.h.DeleteOnNilMapValue {
  11070. delete(v, mk)
  11071. } else {
  11072. v[mk] = 0
  11073. }
  11074. continue
  11075. }
  11076. mv = dd.DecodeFloat64()
  11077. if v != nil {
  11078. v[mk] = mv
  11079. }
  11080. }
  11081. dd.ReadMapEnd()
  11082. d.depthDecr()
  11083. return v, changed
  11084. }
  11085. func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  11086. if rv.Kind() == reflect.Ptr {
  11087. vp := rv2i(rv).(*map[int]bool)
  11088. v, changed := fastpathTV.DecMapIntBoolV(*vp, true, d)
  11089. if changed {
  11090. *vp = v
  11091. }
  11092. } else {
  11093. fastpathTV.DecMapIntBoolV(rv2i(rv).(map[int]bool), false, d)
  11094. }
  11095. }
  11096. func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
  11097. v, changed := f.DecMapIntBoolV(*vp, true, d)
  11098. if changed {
  11099. *vp = v
  11100. }
  11101. }
  11102. func (_ fastpathT) DecMapIntBoolV(v map[int]bool, canChange bool,
  11103. d *Decoder) (_ map[int]bool, changed bool) {
  11104. dd, esep := d.d, d.hh.hasElemSeparators()
  11105. containerLen := dd.ReadMapStart()
  11106. if canChange && v == nil {
  11107. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  11108. v = make(map[int]bool, xlen)
  11109. changed = true
  11110. }
  11111. if containerLen == 0 {
  11112. dd.ReadMapEnd()
  11113. return v, changed
  11114. }
  11115. d.depthIncr()
  11116. var mk int
  11117. var mv bool
  11118. hasLen := containerLen > 0
  11119. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11120. if esep {
  11121. dd.ReadMapElemKey()
  11122. }
  11123. mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  11124. if esep {
  11125. dd.ReadMapElemValue()
  11126. }
  11127. if dd.TryDecodeAsNil() {
  11128. if v == nil {
  11129. } else if d.h.DeleteOnNilMapValue {
  11130. delete(v, mk)
  11131. } else {
  11132. v[mk] = false
  11133. }
  11134. continue
  11135. }
  11136. mv = dd.DecodeBool()
  11137. if v != nil {
  11138. v[mk] = mv
  11139. }
  11140. }
  11141. dd.ReadMapEnd()
  11142. d.depthDecr()
  11143. return v, changed
  11144. }
  11145. func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  11146. if rv.Kind() == reflect.Ptr {
  11147. vp := rv2i(rv).(*map[int64]interface{})
  11148. v, changed := fastpathTV.DecMapInt64IntfV(*vp, true, d)
  11149. if changed {
  11150. *vp = v
  11151. }
  11152. } else {
  11153. fastpathTV.DecMapInt64IntfV(rv2i(rv).(map[int64]interface{}), false, d)
  11154. }
  11155. }
  11156. func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) {
  11157. v, changed := f.DecMapInt64IntfV(*vp, true, d)
  11158. if changed {
  11159. *vp = v
  11160. }
  11161. }
  11162. func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, canChange bool,
  11163. d *Decoder) (_ map[int64]interface{}, changed bool) {
  11164. dd, esep := d.d, d.hh.hasElemSeparators()
  11165. containerLen := dd.ReadMapStart()
  11166. if canChange && v == nil {
  11167. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  11168. v = make(map[int64]interface{}, xlen)
  11169. changed = true
  11170. }
  11171. if containerLen == 0 {
  11172. dd.ReadMapEnd()
  11173. return v, changed
  11174. }
  11175. d.depthIncr()
  11176. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  11177. var mk int64
  11178. var mv interface{}
  11179. hasLen := containerLen > 0
  11180. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11181. if esep {
  11182. dd.ReadMapElemKey()
  11183. }
  11184. mk = dd.DecodeInt64()
  11185. if esep {
  11186. dd.ReadMapElemValue()
  11187. }
  11188. if dd.TryDecodeAsNil() {
  11189. if v == nil {
  11190. } else if d.h.DeleteOnNilMapValue {
  11191. delete(v, mk)
  11192. } else {
  11193. v[mk] = nil
  11194. }
  11195. continue
  11196. }
  11197. if mapGet {
  11198. mv = v[mk]
  11199. } else {
  11200. mv = nil
  11201. }
  11202. d.decode(&mv)
  11203. if v != nil {
  11204. v[mk] = mv
  11205. }
  11206. }
  11207. dd.ReadMapEnd()
  11208. d.depthDecr()
  11209. return v, changed
  11210. }
  11211. func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  11212. if rv.Kind() == reflect.Ptr {
  11213. vp := rv2i(rv).(*map[int64]string)
  11214. v, changed := fastpathTV.DecMapInt64StringV(*vp, true, d)
  11215. if changed {
  11216. *vp = v
  11217. }
  11218. } else {
  11219. fastpathTV.DecMapInt64StringV(rv2i(rv).(map[int64]string), false, d)
  11220. }
  11221. }
  11222. func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) {
  11223. v, changed := f.DecMapInt64StringV(*vp, true, d)
  11224. if changed {
  11225. *vp = v
  11226. }
  11227. }
  11228. func (_ fastpathT) DecMapInt64StringV(v map[int64]string, canChange bool,
  11229. d *Decoder) (_ map[int64]string, changed bool) {
  11230. dd, esep := d.d, d.hh.hasElemSeparators()
  11231. containerLen := dd.ReadMapStart()
  11232. if canChange && v == nil {
  11233. xlen := decInferLen(containerLen, d.h.MaxInitLen, 24)
  11234. v = make(map[int64]string, xlen)
  11235. changed = true
  11236. }
  11237. if containerLen == 0 {
  11238. dd.ReadMapEnd()
  11239. return v, changed
  11240. }
  11241. d.depthIncr()
  11242. var mk int64
  11243. var mv string
  11244. hasLen := containerLen > 0
  11245. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11246. if esep {
  11247. dd.ReadMapElemKey()
  11248. }
  11249. mk = dd.DecodeInt64()
  11250. if esep {
  11251. dd.ReadMapElemValue()
  11252. }
  11253. if dd.TryDecodeAsNil() {
  11254. if v == nil {
  11255. } else if d.h.DeleteOnNilMapValue {
  11256. delete(v, mk)
  11257. } else {
  11258. v[mk] = ""
  11259. }
  11260. continue
  11261. }
  11262. mv = dd.DecodeString()
  11263. if v != nil {
  11264. v[mk] = mv
  11265. }
  11266. }
  11267. dd.ReadMapEnd()
  11268. d.depthDecr()
  11269. return v, changed
  11270. }
  11271. func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  11272. if rv.Kind() == reflect.Ptr {
  11273. vp := rv2i(rv).(*map[int64]uint)
  11274. v, changed := fastpathTV.DecMapInt64UintV(*vp, true, d)
  11275. if changed {
  11276. *vp = v
  11277. }
  11278. } else {
  11279. fastpathTV.DecMapInt64UintV(rv2i(rv).(map[int64]uint), false, d)
  11280. }
  11281. }
  11282. func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) {
  11283. v, changed := f.DecMapInt64UintV(*vp, true, d)
  11284. if changed {
  11285. *vp = v
  11286. }
  11287. }
  11288. func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, canChange bool,
  11289. d *Decoder) (_ map[int64]uint, changed bool) {
  11290. dd, esep := d.d, d.hh.hasElemSeparators()
  11291. containerLen := dd.ReadMapStart()
  11292. if canChange && v == nil {
  11293. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11294. v = make(map[int64]uint, xlen)
  11295. changed = true
  11296. }
  11297. if containerLen == 0 {
  11298. dd.ReadMapEnd()
  11299. return v, changed
  11300. }
  11301. d.depthIncr()
  11302. var mk int64
  11303. var mv uint
  11304. hasLen := containerLen > 0
  11305. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11306. if esep {
  11307. dd.ReadMapElemKey()
  11308. }
  11309. mk = dd.DecodeInt64()
  11310. if esep {
  11311. dd.ReadMapElemValue()
  11312. }
  11313. if dd.TryDecodeAsNil() {
  11314. if v == nil {
  11315. } else if d.h.DeleteOnNilMapValue {
  11316. delete(v, mk)
  11317. } else {
  11318. v[mk] = 0
  11319. }
  11320. continue
  11321. }
  11322. mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  11323. if v != nil {
  11324. v[mk] = mv
  11325. }
  11326. }
  11327. dd.ReadMapEnd()
  11328. d.depthDecr()
  11329. return v, changed
  11330. }
  11331. func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  11332. if rv.Kind() == reflect.Ptr {
  11333. vp := rv2i(rv).(*map[int64]uint8)
  11334. v, changed := fastpathTV.DecMapInt64Uint8V(*vp, true, d)
  11335. if changed {
  11336. *vp = v
  11337. }
  11338. } else {
  11339. fastpathTV.DecMapInt64Uint8V(rv2i(rv).(map[int64]uint8), false, d)
  11340. }
  11341. }
  11342. func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) {
  11343. v, changed := f.DecMapInt64Uint8V(*vp, true, d)
  11344. if changed {
  11345. *vp = v
  11346. }
  11347. }
  11348. func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, canChange bool,
  11349. d *Decoder) (_ map[int64]uint8, changed bool) {
  11350. dd, esep := d.d, d.hh.hasElemSeparators()
  11351. containerLen := dd.ReadMapStart()
  11352. if canChange && v == nil {
  11353. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  11354. v = make(map[int64]uint8, xlen)
  11355. changed = true
  11356. }
  11357. if containerLen == 0 {
  11358. dd.ReadMapEnd()
  11359. return v, changed
  11360. }
  11361. d.depthIncr()
  11362. var mk int64
  11363. var mv uint8
  11364. hasLen := containerLen > 0
  11365. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11366. if esep {
  11367. dd.ReadMapElemKey()
  11368. }
  11369. mk = dd.DecodeInt64()
  11370. if esep {
  11371. dd.ReadMapElemValue()
  11372. }
  11373. if dd.TryDecodeAsNil() {
  11374. if v == nil {
  11375. } else if d.h.DeleteOnNilMapValue {
  11376. delete(v, mk)
  11377. } else {
  11378. v[mk] = 0
  11379. }
  11380. continue
  11381. }
  11382. mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8))
  11383. if v != nil {
  11384. v[mk] = mv
  11385. }
  11386. }
  11387. dd.ReadMapEnd()
  11388. d.depthDecr()
  11389. return v, changed
  11390. }
  11391. func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  11392. if rv.Kind() == reflect.Ptr {
  11393. vp := rv2i(rv).(*map[int64]uint64)
  11394. v, changed := fastpathTV.DecMapInt64Uint64V(*vp, true, d)
  11395. if changed {
  11396. *vp = v
  11397. }
  11398. } else {
  11399. fastpathTV.DecMapInt64Uint64V(rv2i(rv).(map[int64]uint64), false, d)
  11400. }
  11401. }
  11402. func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) {
  11403. v, changed := f.DecMapInt64Uint64V(*vp, true, d)
  11404. if changed {
  11405. *vp = v
  11406. }
  11407. }
  11408. func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, canChange bool,
  11409. d *Decoder) (_ map[int64]uint64, changed bool) {
  11410. dd, esep := d.d, d.hh.hasElemSeparators()
  11411. containerLen := dd.ReadMapStart()
  11412. if canChange && v == nil {
  11413. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11414. v = make(map[int64]uint64, xlen)
  11415. changed = true
  11416. }
  11417. if containerLen == 0 {
  11418. dd.ReadMapEnd()
  11419. return v, changed
  11420. }
  11421. d.depthIncr()
  11422. var mk int64
  11423. var mv uint64
  11424. hasLen := containerLen > 0
  11425. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11426. if esep {
  11427. dd.ReadMapElemKey()
  11428. }
  11429. mk = dd.DecodeInt64()
  11430. if esep {
  11431. dd.ReadMapElemValue()
  11432. }
  11433. if dd.TryDecodeAsNil() {
  11434. if v == nil {
  11435. } else if d.h.DeleteOnNilMapValue {
  11436. delete(v, mk)
  11437. } else {
  11438. v[mk] = 0
  11439. }
  11440. continue
  11441. }
  11442. mv = dd.DecodeUint64()
  11443. if v != nil {
  11444. v[mk] = mv
  11445. }
  11446. }
  11447. dd.ReadMapEnd()
  11448. d.depthDecr()
  11449. return v, changed
  11450. }
  11451. func (d *Decoder) fastpathDecMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) {
  11452. if rv.Kind() == reflect.Ptr {
  11453. vp := rv2i(rv).(*map[int64]uintptr)
  11454. v, changed := fastpathTV.DecMapInt64UintptrV(*vp, true, d)
  11455. if changed {
  11456. *vp = v
  11457. }
  11458. } else {
  11459. fastpathTV.DecMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), false, d)
  11460. }
  11461. }
  11462. func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, d *Decoder) {
  11463. v, changed := f.DecMapInt64UintptrV(*vp, true, d)
  11464. if changed {
  11465. *vp = v
  11466. }
  11467. }
  11468. func (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, canChange bool,
  11469. d *Decoder) (_ map[int64]uintptr, changed bool) {
  11470. dd, esep := d.d, d.hh.hasElemSeparators()
  11471. containerLen := dd.ReadMapStart()
  11472. if canChange && v == nil {
  11473. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11474. v = make(map[int64]uintptr, xlen)
  11475. changed = true
  11476. }
  11477. if containerLen == 0 {
  11478. dd.ReadMapEnd()
  11479. return v, changed
  11480. }
  11481. d.depthIncr()
  11482. var mk int64
  11483. var mv uintptr
  11484. hasLen := containerLen > 0
  11485. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11486. if esep {
  11487. dd.ReadMapElemKey()
  11488. }
  11489. mk = dd.DecodeInt64()
  11490. if esep {
  11491. dd.ReadMapElemValue()
  11492. }
  11493. if dd.TryDecodeAsNil() {
  11494. if v == nil {
  11495. } else if d.h.DeleteOnNilMapValue {
  11496. delete(v, mk)
  11497. } else {
  11498. v[mk] = 0
  11499. }
  11500. continue
  11501. }
  11502. mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))
  11503. if v != nil {
  11504. v[mk] = mv
  11505. }
  11506. }
  11507. dd.ReadMapEnd()
  11508. d.depthDecr()
  11509. return v, changed
  11510. }
  11511. func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  11512. if rv.Kind() == reflect.Ptr {
  11513. vp := rv2i(rv).(*map[int64]int)
  11514. v, changed := fastpathTV.DecMapInt64IntV(*vp, true, d)
  11515. if changed {
  11516. *vp = v
  11517. }
  11518. } else {
  11519. fastpathTV.DecMapInt64IntV(rv2i(rv).(map[int64]int), false, d)
  11520. }
  11521. }
  11522. func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) {
  11523. v, changed := f.DecMapInt64IntV(*vp, true, d)
  11524. if changed {
  11525. *vp = v
  11526. }
  11527. }
  11528. func (_ fastpathT) DecMapInt64IntV(v map[int64]int, canChange bool,
  11529. d *Decoder) (_ map[int64]int, changed bool) {
  11530. dd, esep := d.d, d.hh.hasElemSeparators()
  11531. containerLen := dd.ReadMapStart()
  11532. if canChange && v == nil {
  11533. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11534. v = make(map[int64]int, xlen)
  11535. changed = true
  11536. }
  11537. if containerLen == 0 {
  11538. dd.ReadMapEnd()
  11539. return v, changed
  11540. }
  11541. d.depthIncr()
  11542. var mk int64
  11543. var mv int
  11544. hasLen := containerLen > 0
  11545. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11546. if esep {
  11547. dd.ReadMapElemKey()
  11548. }
  11549. mk = dd.DecodeInt64()
  11550. if esep {
  11551. dd.ReadMapElemValue()
  11552. }
  11553. if dd.TryDecodeAsNil() {
  11554. if v == nil {
  11555. } else if d.h.DeleteOnNilMapValue {
  11556. delete(v, mk)
  11557. } else {
  11558. v[mk] = 0
  11559. }
  11560. continue
  11561. }
  11562. mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))
  11563. if v != nil {
  11564. v[mk] = mv
  11565. }
  11566. }
  11567. dd.ReadMapEnd()
  11568. d.depthDecr()
  11569. return v, changed
  11570. }
  11571. func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  11572. if rv.Kind() == reflect.Ptr {
  11573. vp := rv2i(rv).(*map[int64]int64)
  11574. v, changed := fastpathTV.DecMapInt64Int64V(*vp, true, d)
  11575. if changed {
  11576. *vp = v
  11577. }
  11578. } else {
  11579. fastpathTV.DecMapInt64Int64V(rv2i(rv).(map[int64]int64), false, d)
  11580. }
  11581. }
  11582. func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) {
  11583. v, changed := f.DecMapInt64Int64V(*vp, true, d)
  11584. if changed {
  11585. *vp = v
  11586. }
  11587. }
  11588. func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, canChange bool,
  11589. d *Decoder) (_ map[int64]int64, changed bool) {
  11590. dd, esep := d.d, d.hh.hasElemSeparators()
  11591. containerLen := dd.ReadMapStart()
  11592. if canChange && v == nil {
  11593. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11594. v = make(map[int64]int64, xlen)
  11595. changed = true
  11596. }
  11597. if containerLen == 0 {
  11598. dd.ReadMapEnd()
  11599. return v, changed
  11600. }
  11601. d.depthIncr()
  11602. var mk int64
  11603. var mv int64
  11604. hasLen := containerLen > 0
  11605. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11606. if esep {
  11607. dd.ReadMapElemKey()
  11608. }
  11609. mk = dd.DecodeInt64()
  11610. if esep {
  11611. dd.ReadMapElemValue()
  11612. }
  11613. if dd.TryDecodeAsNil() {
  11614. if v == nil {
  11615. } else if d.h.DeleteOnNilMapValue {
  11616. delete(v, mk)
  11617. } else {
  11618. v[mk] = 0
  11619. }
  11620. continue
  11621. }
  11622. mv = dd.DecodeInt64()
  11623. if v != nil {
  11624. v[mk] = mv
  11625. }
  11626. }
  11627. dd.ReadMapEnd()
  11628. d.depthDecr()
  11629. return v, changed
  11630. }
  11631. func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  11632. if rv.Kind() == reflect.Ptr {
  11633. vp := rv2i(rv).(*map[int64]float32)
  11634. v, changed := fastpathTV.DecMapInt64Float32V(*vp, true, d)
  11635. if changed {
  11636. *vp = v
  11637. }
  11638. } else {
  11639. fastpathTV.DecMapInt64Float32V(rv2i(rv).(map[int64]float32), false, d)
  11640. }
  11641. }
  11642. func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) {
  11643. v, changed := f.DecMapInt64Float32V(*vp, true, d)
  11644. if changed {
  11645. *vp = v
  11646. }
  11647. }
  11648. func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, canChange bool,
  11649. d *Decoder) (_ map[int64]float32, changed bool) {
  11650. dd, esep := d.d, d.hh.hasElemSeparators()
  11651. containerLen := dd.ReadMapStart()
  11652. if canChange && v == nil {
  11653. xlen := decInferLen(containerLen, d.h.MaxInitLen, 12)
  11654. v = make(map[int64]float32, xlen)
  11655. changed = true
  11656. }
  11657. if containerLen == 0 {
  11658. dd.ReadMapEnd()
  11659. return v, changed
  11660. }
  11661. d.depthIncr()
  11662. var mk int64
  11663. var mv float32
  11664. hasLen := containerLen > 0
  11665. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11666. if esep {
  11667. dd.ReadMapElemKey()
  11668. }
  11669. mk = dd.DecodeInt64()
  11670. if esep {
  11671. dd.ReadMapElemValue()
  11672. }
  11673. if dd.TryDecodeAsNil() {
  11674. if v == nil {
  11675. } else if d.h.DeleteOnNilMapValue {
  11676. delete(v, mk)
  11677. } else {
  11678. v[mk] = 0
  11679. }
  11680. continue
  11681. }
  11682. mv = float32(chkOvf.Float32V(dd.DecodeFloat64()))
  11683. if v != nil {
  11684. v[mk] = mv
  11685. }
  11686. }
  11687. dd.ReadMapEnd()
  11688. d.depthDecr()
  11689. return v, changed
  11690. }
  11691. func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  11692. if rv.Kind() == reflect.Ptr {
  11693. vp := rv2i(rv).(*map[int64]float64)
  11694. v, changed := fastpathTV.DecMapInt64Float64V(*vp, true, d)
  11695. if changed {
  11696. *vp = v
  11697. }
  11698. } else {
  11699. fastpathTV.DecMapInt64Float64V(rv2i(rv).(map[int64]float64), false, d)
  11700. }
  11701. }
  11702. func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) {
  11703. v, changed := f.DecMapInt64Float64V(*vp, true, d)
  11704. if changed {
  11705. *vp = v
  11706. }
  11707. }
  11708. func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, canChange bool,
  11709. d *Decoder) (_ map[int64]float64, changed bool) {
  11710. dd, esep := d.d, d.hh.hasElemSeparators()
  11711. containerLen := dd.ReadMapStart()
  11712. if canChange && v == nil {
  11713. xlen := decInferLen(containerLen, d.h.MaxInitLen, 16)
  11714. v = make(map[int64]float64, xlen)
  11715. changed = true
  11716. }
  11717. if containerLen == 0 {
  11718. dd.ReadMapEnd()
  11719. return v, changed
  11720. }
  11721. d.depthIncr()
  11722. var mk int64
  11723. var mv float64
  11724. hasLen := containerLen > 0
  11725. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11726. if esep {
  11727. dd.ReadMapElemKey()
  11728. }
  11729. mk = dd.DecodeInt64()
  11730. if esep {
  11731. dd.ReadMapElemValue()
  11732. }
  11733. if dd.TryDecodeAsNil() {
  11734. if v == nil {
  11735. } else if d.h.DeleteOnNilMapValue {
  11736. delete(v, mk)
  11737. } else {
  11738. v[mk] = 0
  11739. }
  11740. continue
  11741. }
  11742. mv = dd.DecodeFloat64()
  11743. if v != nil {
  11744. v[mk] = mv
  11745. }
  11746. }
  11747. dd.ReadMapEnd()
  11748. d.depthDecr()
  11749. return v, changed
  11750. }
  11751. func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  11752. if rv.Kind() == reflect.Ptr {
  11753. vp := rv2i(rv).(*map[int64]bool)
  11754. v, changed := fastpathTV.DecMapInt64BoolV(*vp, true, d)
  11755. if changed {
  11756. *vp = v
  11757. }
  11758. } else {
  11759. fastpathTV.DecMapInt64BoolV(rv2i(rv).(map[int64]bool), false, d)
  11760. }
  11761. }
  11762. func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) {
  11763. v, changed := f.DecMapInt64BoolV(*vp, true, d)
  11764. if changed {
  11765. *vp = v
  11766. }
  11767. }
  11768. func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, canChange bool,
  11769. d *Decoder) (_ map[int64]bool, changed bool) {
  11770. dd, esep := d.d, d.hh.hasElemSeparators()
  11771. containerLen := dd.ReadMapStart()
  11772. if canChange && v == nil {
  11773. xlen := decInferLen(containerLen, d.h.MaxInitLen, 9)
  11774. v = make(map[int64]bool, xlen)
  11775. changed = true
  11776. }
  11777. if containerLen == 0 {
  11778. dd.ReadMapEnd()
  11779. return v, changed
  11780. }
  11781. d.depthIncr()
  11782. var mk int64
  11783. var mv bool
  11784. hasLen := containerLen > 0
  11785. for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ {
  11786. if esep {
  11787. dd.ReadMapElemKey()
  11788. }
  11789. mk = dd.DecodeInt64()
  11790. if esep {
  11791. dd.ReadMapElemValue()
  11792. }
  11793. if dd.TryDecodeAsNil() {
  11794. if v == nil {
  11795. } else if d.h.DeleteOnNilMapValue {
  11796. delete(v, mk)
  11797. } else {
  11798. v[mk] = false
  11799. }
  11800. continue
  11801. }
  11802. mv = dd.DecodeBool()
  11803. if v != nil {
  11804. v[mk] = mv
  11805. }
  11806. }
  11807. dd.ReadMapEnd()
  11808. d.depthDecr()
  11809. return v, changed
  11810. }