fast-path.generated.go 225 KB

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