fast-path.generated.go 224 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094
  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. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4383. return
  4384. }
  4385. slh.ElemContainerState(j)
  4386. d.decode(&v[uint(j)])
  4387. }
  4388. slh.End()
  4389. }
  4390. func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) {
  4391. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4392. vp := rv2i(rv).(*[]string)
  4393. if v, changed := fastpathTV.DecSliceStringY(*vp, d); changed {
  4394. *vp = v
  4395. }
  4396. } else {
  4397. fastpathTV.DecSliceStringN(rv2i(rv).([]string), d)
  4398. }
  4399. }
  4400. func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) {
  4401. if v, changed := f.DecSliceStringY(*vp, d); changed {
  4402. *vp = v
  4403. }
  4404. }
  4405. func (fastpathT) DecSliceStringY(v []string, d *Decoder) (_ []string, changed bool) {
  4406. slh, containerLenS := d.decSliceHelperStart()
  4407. if slh.IsNil {
  4408. if v == nil {
  4409. return
  4410. }
  4411. return nil, true
  4412. }
  4413. if containerLenS == 0 {
  4414. if v == nil {
  4415. v = []string{}
  4416. } else if len(v) != 0 {
  4417. v = v[:0]
  4418. }
  4419. slh.End()
  4420. return v, true
  4421. }
  4422. hasLen := containerLenS > 0
  4423. var xlen int
  4424. if hasLen {
  4425. if containerLenS > cap(v) {
  4426. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4427. if xlen <= cap(v) {
  4428. v = v[:uint(xlen)]
  4429. } else {
  4430. v = make([]string, uint(xlen))
  4431. }
  4432. changed = true
  4433. } else if containerLenS != len(v) {
  4434. v = v[:containerLenS]
  4435. changed = true
  4436. }
  4437. }
  4438. var j int
  4439. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4440. if j == 0 && len(v) == 0 {
  4441. if hasLen {
  4442. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16)
  4443. } else {
  4444. xlen = 8
  4445. }
  4446. v = make([]string, uint(xlen))
  4447. changed = true
  4448. }
  4449. if j >= len(v) {
  4450. v = append(v, "")
  4451. changed = true
  4452. }
  4453. slh.ElemContainerState(j)
  4454. v[uint(j)] = string(d.d.DecodeStringAsBytes())
  4455. }
  4456. if j < len(v) {
  4457. v = v[:uint(j)]
  4458. changed = true
  4459. } else if j == 0 && v == nil {
  4460. v = []string{}
  4461. changed = true
  4462. }
  4463. slh.End()
  4464. return v, changed
  4465. }
  4466. func (fastpathT) DecSliceStringN(v []string, d *Decoder) {
  4467. slh, containerLenS := d.decSliceHelperStart()
  4468. if slh.IsNil {
  4469. return
  4470. }
  4471. if containerLenS == 0 {
  4472. slh.End()
  4473. return
  4474. }
  4475. hasLen := containerLenS > 0
  4476. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4477. if j >= len(v) {
  4478. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4479. return
  4480. }
  4481. slh.ElemContainerState(j)
  4482. v[uint(j)] = string(d.d.DecodeStringAsBytes())
  4483. }
  4484. slh.End()
  4485. }
  4486. func (d *Decoder) fastpathDecSliceBytesR(f *codecFnInfo, rv reflect.Value) {
  4487. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4488. vp := rv2i(rv).(*[][]byte)
  4489. if v, changed := fastpathTV.DecSliceBytesY(*vp, d); changed {
  4490. *vp = v
  4491. }
  4492. } else {
  4493. fastpathTV.DecSliceBytesN(rv2i(rv).([][]byte), d)
  4494. }
  4495. }
  4496. func (f fastpathT) DecSliceBytesX(vp *[][]byte, d *Decoder) {
  4497. if v, changed := f.DecSliceBytesY(*vp, d); changed {
  4498. *vp = v
  4499. }
  4500. }
  4501. func (fastpathT) DecSliceBytesY(v [][]byte, d *Decoder) (_ [][]byte, changed bool) {
  4502. slh, containerLenS := d.decSliceHelperStart()
  4503. if slh.IsNil {
  4504. if v == nil {
  4505. return
  4506. }
  4507. return nil, true
  4508. }
  4509. if containerLenS == 0 {
  4510. if v == nil {
  4511. v = [][]byte{}
  4512. } else if len(v) != 0 {
  4513. v = v[:0]
  4514. }
  4515. slh.End()
  4516. return v, true
  4517. }
  4518. hasLen := containerLenS > 0
  4519. var xlen int
  4520. if hasLen {
  4521. if containerLenS > cap(v) {
  4522. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
  4523. if xlen <= cap(v) {
  4524. v = v[:uint(xlen)]
  4525. } else {
  4526. v = make([][]byte, uint(xlen))
  4527. }
  4528. changed = true
  4529. } else if containerLenS != len(v) {
  4530. v = v[:containerLenS]
  4531. changed = true
  4532. }
  4533. }
  4534. var j int
  4535. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4536. if j == 0 && len(v) == 0 {
  4537. if hasLen {
  4538. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 24)
  4539. } else {
  4540. xlen = 8
  4541. }
  4542. v = make([][]byte, uint(xlen))
  4543. changed = true
  4544. }
  4545. if j >= len(v) {
  4546. v = append(v, nil)
  4547. changed = true
  4548. }
  4549. slh.ElemContainerState(j)
  4550. v[uint(j)] = d.d.DecodeBytes(nil, false)
  4551. }
  4552. if j < len(v) {
  4553. v = v[:uint(j)]
  4554. changed = true
  4555. } else if j == 0 && v == nil {
  4556. v = [][]byte{}
  4557. changed = true
  4558. }
  4559. slh.End()
  4560. return v, changed
  4561. }
  4562. func (fastpathT) DecSliceBytesN(v [][]byte, d *Decoder) {
  4563. slh, containerLenS := d.decSliceHelperStart()
  4564. if slh.IsNil {
  4565. return
  4566. }
  4567. if containerLenS == 0 {
  4568. slh.End()
  4569. return
  4570. }
  4571. hasLen := containerLenS > 0
  4572. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4573. if j >= len(v) {
  4574. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4575. return
  4576. }
  4577. slh.ElemContainerState(j)
  4578. v[uint(j)] = d.d.DecodeBytes(nil, false)
  4579. }
  4580. slh.End()
  4581. }
  4582. func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) {
  4583. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4584. vp := rv2i(rv).(*[]float32)
  4585. if v, changed := fastpathTV.DecSliceFloat32Y(*vp, d); changed {
  4586. *vp = v
  4587. }
  4588. } else {
  4589. fastpathTV.DecSliceFloat32N(rv2i(rv).([]float32), d)
  4590. }
  4591. }
  4592. func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) {
  4593. if v, changed := f.DecSliceFloat32Y(*vp, d); changed {
  4594. *vp = v
  4595. }
  4596. }
  4597. func (fastpathT) DecSliceFloat32Y(v []float32, d *Decoder) (_ []float32, changed bool) {
  4598. slh, containerLenS := d.decSliceHelperStart()
  4599. if slh.IsNil {
  4600. if v == nil {
  4601. return
  4602. }
  4603. return nil, true
  4604. }
  4605. if containerLenS == 0 {
  4606. if v == nil {
  4607. v = []float32{}
  4608. } else if len(v) != 0 {
  4609. v = v[:0]
  4610. }
  4611. slh.End()
  4612. return v, true
  4613. }
  4614. hasLen := containerLenS > 0
  4615. var xlen int
  4616. if hasLen {
  4617. if containerLenS > cap(v) {
  4618. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4619. if xlen <= cap(v) {
  4620. v = v[:uint(xlen)]
  4621. } else {
  4622. v = make([]float32, uint(xlen))
  4623. }
  4624. changed = true
  4625. } else if containerLenS != len(v) {
  4626. v = v[:containerLenS]
  4627. changed = true
  4628. }
  4629. }
  4630. var j int
  4631. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4632. if j == 0 && len(v) == 0 {
  4633. if hasLen {
  4634. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  4635. } else {
  4636. xlen = 8
  4637. }
  4638. v = make([]float32, uint(xlen))
  4639. changed = true
  4640. }
  4641. if j >= len(v) {
  4642. v = append(v, 0)
  4643. changed = true
  4644. }
  4645. slh.ElemContainerState(j)
  4646. v[uint(j)] = float32(d.decodeFloat32())
  4647. }
  4648. if j < len(v) {
  4649. v = v[:uint(j)]
  4650. changed = true
  4651. } else if j == 0 && v == nil {
  4652. v = []float32{}
  4653. changed = true
  4654. }
  4655. slh.End()
  4656. return v, changed
  4657. }
  4658. func (fastpathT) DecSliceFloat32N(v []float32, d *Decoder) {
  4659. slh, containerLenS := d.decSliceHelperStart()
  4660. if slh.IsNil {
  4661. return
  4662. }
  4663. if containerLenS == 0 {
  4664. slh.End()
  4665. return
  4666. }
  4667. hasLen := containerLenS > 0
  4668. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4669. if j >= len(v) {
  4670. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4671. return
  4672. }
  4673. slh.ElemContainerState(j)
  4674. v[uint(j)] = float32(d.decodeFloat32())
  4675. }
  4676. slh.End()
  4677. }
  4678. func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) {
  4679. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4680. vp := rv2i(rv).(*[]float64)
  4681. if v, changed := fastpathTV.DecSliceFloat64Y(*vp, d); changed {
  4682. *vp = v
  4683. }
  4684. } else {
  4685. fastpathTV.DecSliceFloat64N(rv2i(rv).([]float64), d)
  4686. }
  4687. }
  4688. func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) {
  4689. if v, changed := f.DecSliceFloat64Y(*vp, d); changed {
  4690. *vp = v
  4691. }
  4692. }
  4693. func (fastpathT) DecSliceFloat64Y(v []float64, d *Decoder) (_ []float64, changed bool) {
  4694. slh, containerLenS := d.decSliceHelperStart()
  4695. if slh.IsNil {
  4696. if v == nil {
  4697. return
  4698. }
  4699. return nil, true
  4700. }
  4701. if containerLenS == 0 {
  4702. if v == nil {
  4703. v = []float64{}
  4704. } else if len(v) != 0 {
  4705. v = v[:0]
  4706. }
  4707. slh.End()
  4708. return v, true
  4709. }
  4710. hasLen := containerLenS > 0
  4711. var xlen int
  4712. if hasLen {
  4713. if containerLenS > cap(v) {
  4714. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4715. if xlen <= cap(v) {
  4716. v = v[:uint(xlen)]
  4717. } else {
  4718. v = make([]float64, uint(xlen))
  4719. }
  4720. changed = true
  4721. } else if containerLenS != len(v) {
  4722. v = v[:containerLenS]
  4723. changed = true
  4724. }
  4725. }
  4726. var j int
  4727. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4728. if j == 0 && len(v) == 0 {
  4729. if hasLen {
  4730. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4731. } else {
  4732. xlen = 8
  4733. }
  4734. v = make([]float64, uint(xlen))
  4735. changed = true
  4736. }
  4737. if j >= len(v) {
  4738. v = append(v, 0)
  4739. changed = true
  4740. }
  4741. slh.ElemContainerState(j)
  4742. v[uint(j)] = d.d.DecodeFloat64()
  4743. }
  4744. if j < len(v) {
  4745. v = v[:uint(j)]
  4746. changed = true
  4747. } else if j == 0 && v == nil {
  4748. v = []float64{}
  4749. changed = true
  4750. }
  4751. slh.End()
  4752. return v, changed
  4753. }
  4754. func (fastpathT) DecSliceFloat64N(v []float64, d *Decoder) {
  4755. slh, containerLenS := d.decSliceHelperStart()
  4756. if slh.IsNil {
  4757. return
  4758. }
  4759. if containerLenS == 0 {
  4760. slh.End()
  4761. return
  4762. }
  4763. hasLen := containerLenS > 0
  4764. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4765. if j >= len(v) {
  4766. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4767. return
  4768. }
  4769. slh.ElemContainerState(j)
  4770. v[uint(j)] = d.d.DecodeFloat64()
  4771. }
  4772. slh.End()
  4773. }
  4774. func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) {
  4775. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4776. vp := rv2i(rv).(*[]uint)
  4777. if v, changed := fastpathTV.DecSliceUintY(*vp, d); changed {
  4778. *vp = v
  4779. }
  4780. } else {
  4781. fastpathTV.DecSliceUintN(rv2i(rv).([]uint), d)
  4782. }
  4783. }
  4784. func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) {
  4785. if v, changed := f.DecSliceUintY(*vp, d); changed {
  4786. *vp = v
  4787. }
  4788. }
  4789. func (fastpathT) DecSliceUintY(v []uint, d *Decoder) (_ []uint, changed bool) {
  4790. slh, containerLenS := d.decSliceHelperStart()
  4791. if slh.IsNil {
  4792. if v == nil {
  4793. return
  4794. }
  4795. return nil, true
  4796. }
  4797. if containerLenS == 0 {
  4798. if v == nil {
  4799. v = []uint{}
  4800. } else if len(v) != 0 {
  4801. v = v[:0]
  4802. }
  4803. slh.End()
  4804. return v, true
  4805. }
  4806. hasLen := containerLenS > 0
  4807. var xlen int
  4808. if hasLen {
  4809. if containerLenS > cap(v) {
  4810. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4811. if xlen <= cap(v) {
  4812. v = v[:uint(xlen)]
  4813. } else {
  4814. v = make([]uint, uint(xlen))
  4815. }
  4816. changed = true
  4817. } else if containerLenS != len(v) {
  4818. v = v[:containerLenS]
  4819. changed = true
  4820. }
  4821. }
  4822. var j int
  4823. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4824. if j == 0 && len(v) == 0 {
  4825. if hasLen {
  4826. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  4827. } else {
  4828. xlen = 8
  4829. }
  4830. v = make([]uint, uint(xlen))
  4831. changed = true
  4832. }
  4833. if j >= len(v) {
  4834. v = append(v, 0)
  4835. changed = true
  4836. }
  4837. slh.ElemContainerState(j)
  4838. v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  4839. }
  4840. if j < len(v) {
  4841. v = v[:uint(j)]
  4842. changed = true
  4843. } else if j == 0 && v == nil {
  4844. v = []uint{}
  4845. changed = true
  4846. }
  4847. slh.End()
  4848. return v, changed
  4849. }
  4850. func (fastpathT) DecSliceUintN(v []uint, d *Decoder) {
  4851. slh, containerLenS := d.decSliceHelperStart()
  4852. if slh.IsNil {
  4853. return
  4854. }
  4855. if containerLenS == 0 {
  4856. slh.End()
  4857. return
  4858. }
  4859. hasLen := containerLenS > 0
  4860. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4861. if j >= len(v) {
  4862. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4863. return
  4864. }
  4865. slh.ElemContainerState(j)
  4866. v[uint(j)] = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  4867. }
  4868. slh.End()
  4869. }
  4870. func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) {
  4871. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4872. vp := rv2i(rv).(*[]uint16)
  4873. if v, changed := fastpathTV.DecSliceUint16Y(*vp, d); changed {
  4874. *vp = v
  4875. }
  4876. } else {
  4877. fastpathTV.DecSliceUint16N(rv2i(rv).([]uint16), d)
  4878. }
  4879. }
  4880. func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) {
  4881. if v, changed := f.DecSliceUint16Y(*vp, d); changed {
  4882. *vp = v
  4883. }
  4884. }
  4885. func (fastpathT) DecSliceUint16Y(v []uint16, d *Decoder) (_ []uint16, changed bool) {
  4886. slh, containerLenS := d.decSliceHelperStart()
  4887. if slh.IsNil {
  4888. if v == nil {
  4889. return
  4890. }
  4891. return nil, true
  4892. }
  4893. if containerLenS == 0 {
  4894. if v == nil {
  4895. v = []uint16{}
  4896. } else if len(v) != 0 {
  4897. v = v[:0]
  4898. }
  4899. slh.End()
  4900. return v, true
  4901. }
  4902. hasLen := containerLenS > 0
  4903. var xlen int
  4904. if hasLen {
  4905. if containerLenS > cap(v) {
  4906. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  4907. if xlen <= cap(v) {
  4908. v = v[:uint(xlen)]
  4909. } else {
  4910. v = make([]uint16, uint(xlen))
  4911. }
  4912. changed = true
  4913. } else if containerLenS != len(v) {
  4914. v = v[:containerLenS]
  4915. changed = true
  4916. }
  4917. }
  4918. var j int
  4919. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4920. if j == 0 && len(v) == 0 {
  4921. if hasLen {
  4922. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  4923. } else {
  4924. xlen = 8
  4925. }
  4926. v = make([]uint16, uint(xlen))
  4927. changed = true
  4928. }
  4929. if j >= len(v) {
  4930. v = append(v, 0)
  4931. changed = true
  4932. }
  4933. slh.ElemContainerState(j)
  4934. v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
  4935. }
  4936. if j < len(v) {
  4937. v = v[:uint(j)]
  4938. changed = true
  4939. } else if j == 0 && v == nil {
  4940. v = []uint16{}
  4941. changed = true
  4942. }
  4943. slh.End()
  4944. return v, changed
  4945. }
  4946. func (fastpathT) DecSliceUint16N(v []uint16, d *Decoder) {
  4947. slh, containerLenS := d.decSliceHelperStart()
  4948. if slh.IsNil {
  4949. return
  4950. }
  4951. if containerLenS == 0 {
  4952. slh.End()
  4953. return
  4954. }
  4955. hasLen := containerLenS > 0
  4956. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  4957. if j >= len(v) {
  4958. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  4959. return
  4960. }
  4961. slh.ElemContainerState(j)
  4962. v[uint(j)] = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16))
  4963. }
  4964. slh.End()
  4965. }
  4966. func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) {
  4967. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  4968. vp := rv2i(rv).(*[]uint32)
  4969. if v, changed := fastpathTV.DecSliceUint32Y(*vp, d); changed {
  4970. *vp = v
  4971. }
  4972. } else {
  4973. fastpathTV.DecSliceUint32N(rv2i(rv).([]uint32), d)
  4974. }
  4975. }
  4976. func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) {
  4977. if v, changed := f.DecSliceUint32Y(*vp, d); changed {
  4978. *vp = v
  4979. }
  4980. }
  4981. func (fastpathT) DecSliceUint32Y(v []uint32, d *Decoder) (_ []uint32, changed bool) {
  4982. slh, containerLenS := d.decSliceHelperStart()
  4983. if slh.IsNil {
  4984. if v == nil {
  4985. return
  4986. }
  4987. return nil, true
  4988. }
  4989. if containerLenS == 0 {
  4990. if v == nil {
  4991. v = []uint32{}
  4992. } else if len(v) != 0 {
  4993. v = v[:0]
  4994. }
  4995. slh.End()
  4996. return v, true
  4997. }
  4998. hasLen := containerLenS > 0
  4999. var xlen int
  5000. if hasLen {
  5001. if containerLenS > cap(v) {
  5002. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5003. if xlen <= cap(v) {
  5004. v = v[:uint(xlen)]
  5005. } else {
  5006. v = make([]uint32, uint(xlen))
  5007. }
  5008. changed = true
  5009. } else if containerLenS != len(v) {
  5010. v = v[:containerLenS]
  5011. changed = true
  5012. }
  5013. }
  5014. var j int
  5015. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5016. if j == 0 && len(v) == 0 {
  5017. if hasLen {
  5018. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5019. } else {
  5020. xlen = 8
  5021. }
  5022. v = make([]uint32, uint(xlen))
  5023. changed = true
  5024. }
  5025. if j >= len(v) {
  5026. v = append(v, 0)
  5027. changed = true
  5028. }
  5029. slh.ElemContainerState(j)
  5030. v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
  5031. }
  5032. if j < len(v) {
  5033. v = v[:uint(j)]
  5034. changed = true
  5035. } else if j == 0 && v == nil {
  5036. v = []uint32{}
  5037. changed = true
  5038. }
  5039. slh.End()
  5040. return v, changed
  5041. }
  5042. func (fastpathT) DecSliceUint32N(v []uint32, d *Decoder) {
  5043. slh, containerLenS := d.decSliceHelperStart()
  5044. if slh.IsNil {
  5045. return
  5046. }
  5047. if containerLenS == 0 {
  5048. slh.End()
  5049. return
  5050. }
  5051. hasLen := containerLenS > 0
  5052. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5053. if j >= len(v) {
  5054. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5055. return
  5056. }
  5057. slh.ElemContainerState(j)
  5058. v[uint(j)] = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32))
  5059. }
  5060. slh.End()
  5061. }
  5062. func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) {
  5063. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5064. vp := rv2i(rv).(*[]uint64)
  5065. if v, changed := fastpathTV.DecSliceUint64Y(*vp, d); changed {
  5066. *vp = v
  5067. }
  5068. } else {
  5069. fastpathTV.DecSliceUint64N(rv2i(rv).([]uint64), d)
  5070. }
  5071. }
  5072. func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) {
  5073. if v, changed := f.DecSliceUint64Y(*vp, d); changed {
  5074. *vp = v
  5075. }
  5076. }
  5077. func (fastpathT) DecSliceUint64Y(v []uint64, d *Decoder) (_ []uint64, changed bool) {
  5078. slh, containerLenS := d.decSliceHelperStart()
  5079. if slh.IsNil {
  5080. if v == nil {
  5081. return
  5082. }
  5083. return nil, true
  5084. }
  5085. if containerLenS == 0 {
  5086. if v == nil {
  5087. v = []uint64{}
  5088. } else if len(v) != 0 {
  5089. v = v[:0]
  5090. }
  5091. slh.End()
  5092. return v, true
  5093. }
  5094. hasLen := containerLenS > 0
  5095. var xlen int
  5096. if hasLen {
  5097. if containerLenS > cap(v) {
  5098. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5099. if xlen <= cap(v) {
  5100. v = v[:uint(xlen)]
  5101. } else {
  5102. v = make([]uint64, uint(xlen))
  5103. }
  5104. changed = true
  5105. } else if containerLenS != len(v) {
  5106. v = v[:containerLenS]
  5107. changed = true
  5108. }
  5109. }
  5110. var j int
  5111. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5112. if j == 0 && len(v) == 0 {
  5113. if hasLen {
  5114. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5115. } else {
  5116. xlen = 8
  5117. }
  5118. v = make([]uint64, uint(xlen))
  5119. changed = true
  5120. }
  5121. if j >= len(v) {
  5122. v = append(v, 0)
  5123. changed = true
  5124. }
  5125. slh.ElemContainerState(j)
  5126. v[uint(j)] = d.d.DecodeUint64()
  5127. }
  5128. if j < len(v) {
  5129. v = v[:uint(j)]
  5130. changed = true
  5131. } else if j == 0 && v == nil {
  5132. v = []uint64{}
  5133. changed = true
  5134. }
  5135. slh.End()
  5136. return v, changed
  5137. }
  5138. func (fastpathT) DecSliceUint64N(v []uint64, d *Decoder) {
  5139. slh, containerLenS := d.decSliceHelperStart()
  5140. if slh.IsNil {
  5141. return
  5142. }
  5143. if containerLenS == 0 {
  5144. slh.End()
  5145. return
  5146. }
  5147. hasLen := containerLenS > 0
  5148. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5149. if j >= len(v) {
  5150. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5151. return
  5152. }
  5153. slh.ElemContainerState(j)
  5154. v[uint(j)] = d.d.DecodeUint64()
  5155. }
  5156. slh.End()
  5157. }
  5158. func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) {
  5159. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5160. vp := rv2i(rv).(*[]int)
  5161. if v, changed := fastpathTV.DecSliceIntY(*vp, d); changed {
  5162. *vp = v
  5163. }
  5164. } else {
  5165. fastpathTV.DecSliceIntN(rv2i(rv).([]int), d)
  5166. }
  5167. }
  5168. func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) {
  5169. if v, changed := f.DecSliceIntY(*vp, d); changed {
  5170. *vp = v
  5171. }
  5172. }
  5173. func (fastpathT) DecSliceIntY(v []int, d *Decoder) (_ []int, changed bool) {
  5174. slh, containerLenS := d.decSliceHelperStart()
  5175. if slh.IsNil {
  5176. if v == nil {
  5177. return
  5178. }
  5179. return nil, true
  5180. }
  5181. if containerLenS == 0 {
  5182. if v == nil {
  5183. v = []int{}
  5184. } else if len(v) != 0 {
  5185. v = v[:0]
  5186. }
  5187. slh.End()
  5188. return v, true
  5189. }
  5190. hasLen := containerLenS > 0
  5191. var xlen int
  5192. if hasLen {
  5193. if containerLenS > cap(v) {
  5194. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5195. if xlen <= cap(v) {
  5196. v = v[:uint(xlen)]
  5197. } else {
  5198. v = make([]int, uint(xlen))
  5199. }
  5200. changed = true
  5201. } else if containerLenS != len(v) {
  5202. v = v[:containerLenS]
  5203. changed = true
  5204. }
  5205. }
  5206. var j int
  5207. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5208. if j == 0 && len(v) == 0 {
  5209. if hasLen {
  5210. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5211. } else {
  5212. xlen = 8
  5213. }
  5214. v = make([]int, uint(xlen))
  5215. changed = true
  5216. }
  5217. if j >= len(v) {
  5218. v = append(v, 0)
  5219. changed = true
  5220. }
  5221. slh.ElemContainerState(j)
  5222. v[uint(j)] = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  5223. }
  5224. if j < len(v) {
  5225. v = v[:uint(j)]
  5226. changed = true
  5227. } else if j == 0 && v == nil {
  5228. v = []int{}
  5229. changed = true
  5230. }
  5231. slh.End()
  5232. return v, changed
  5233. }
  5234. func (fastpathT) DecSliceIntN(v []int, d *Decoder) {
  5235. slh, containerLenS := d.decSliceHelperStart()
  5236. if slh.IsNil {
  5237. return
  5238. }
  5239. if containerLenS == 0 {
  5240. slh.End()
  5241. return
  5242. }
  5243. hasLen := containerLenS > 0
  5244. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5245. if j >= len(v) {
  5246. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5247. return
  5248. }
  5249. slh.ElemContainerState(j)
  5250. v[uint(j)] = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  5251. }
  5252. slh.End()
  5253. }
  5254. func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) {
  5255. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5256. vp := rv2i(rv).(*[]int8)
  5257. if v, changed := fastpathTV.DecSliceInt8Y(*vp, d); changed {
  5258. *vp = v
  5259. }
  5260. } else {
  5261. fastpathTV.DecSliceInt8N(rv2i(rv).([]int8), d)
  5262. }
  5263. }
  5264. func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) {
  5265. if v, changed := f.DecSliceInt8Y(*vp, d); changed {
  5266. *vp = v
  5267. }
  5268. }
  5269. func (fastpathT) DecSliceInt8Y(v []int8, d *Decoder) (_ []int8, changed bool) {
  5270. slh, containerLenS := d.decSliceHelperStart()
  5271. if slh.IsNil {
  5272. if v == nil {
  5273. return
  5274. }
  5275. return nil, true
  5276. }
  5277. if containerLenS == 0 {
  5278. if v == nil {
  5279. v = []int8{}
  5280. } else if len(v) != 0 {
  5281. v = v[:0]
  5282. }
  5283. slh.End()
  5284. return v, true
  5285. }
  5286. hasLen := containerLenS > 0
  5287. var xlen int
  5288. if hasLen {
  5289. if containerLenS > cap(v) {
  5290. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5291. if xlen <= cap(v) {
  5292. v = v[:uint(xlen)]
  5293. } else {
  5294. v = make([]int8, uint(xlen))
  5295. }
  5296. changed = true
  5297. } else if containerLenS != len(v) {
  5298. v = v[:containerLenS]
  5299. changed = true
  5300. }
  5301. }
  5302. var j int
  5303. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5304. if j == 0 && len(v) == 0 {
  5305. if hasLen {
  5306. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5307. } else {
  5308. xlen = 8
  5309. }
  5310. v = make([]int8, uint(xlen))
  5311. changed = true
  5312. }
  5313. if j >= len(v) {
  5314. v = append(v, 0)
  5315. changed = true
  5316. }
  5317. slh.ElemContainerState(j)
  5318. v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
  5319. }
  5320. if j < len(v) {
  5321. v = v[:uint(j)]
  5322. changed = true
  5323. } else if j == 0 && v == nil {
  5324. v = []int8{}
  5325. changed = true
  5326. }
  5327. slh.End()
  5328. return v, changed
  5329. }
  5330. func (fastpathT) DecSliceInt8N(v []int8, d *Decoder) {
  5331. slh, containerLenS := d.decSliceHelperStart()
  5332. if slh.IsNil {
  5333. return
  5334. }
  5335. if containerLenS == 0 {
  5336. slh.End()
  5337. return
  5338. }
  5339. hasLen := containerLenS > 0
  5340. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5341. if j >= len(v) {
  5342. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5343. return
  5344. }
  5345. slh.ElemContainerState(j)
  5346. v[uint(j)] = int8(chkOvf.IntV(d.d.DecodeInt64(), 8))
  5347. }
  5348. slh.End()
  5349. }
  5350. func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) {
  5351. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5352. vp := rv2i(rv).(*[]int16)
  5353. if v, changed := fastpathTV.DecSliceInt16Y(*vp, d); changed {
  5354. *vp = v
  5355. }
  5356. } else {
  5357. fastpathTV.DecSliceInt16N(rv2i(rv).([]int16), d)
  5358. }
  5359. }
  5360. func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) {
  5361. if v, changed := f.DecSliceInt16Y(*vp, d); changed {
  5362. *vp = v
  5363. }
  5364. }
  5365. func (fastpathT) DecSliceInt16Y(v []int16, d *Decoder) (_ []int16, changed bool) {
  5366. slh, containerLenS := d.decSliceHelperStart()
  5367. if slh.IsNil {
  5368. if v == nil {
  5369. return
  5370. }
  5371. return nil, true
  5372. }
  5373. if containerLenS == 0 {
  5374. if v == nil {
  5375. v = []int16{}
  5376. } else if len(v) != 0 {
  5377. v = v[:0]
  5378. }
  5379. slh.End()
  5380. return v, true
  5381. }
  5382. hasLen := containerLenS > 0
  5383. var xlen int
  5384. if hasLen {
  5385. if containerLenS > cap(v) {
  5386. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  5387. if xlen <= cap(v) {
  5388. v = v[:uint(xlen)]
  5389. } else {
  5390. v = make([]int16, uint(xlen))
  5391. }
  5392. changed = true
  5393. } else if containerLenS != len(v) {
  5394. v = v[:containerLenS]
  5395. changed = true
  5396. }
  5397. }
  5398. var j int
  5399. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5400. if j == 0 && len(v) == 0 {
  5401. if hasLen {
  5402. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2)
  5403. } else {
  5404. xlen = 8
  5405. }
  5406. v = make([]int16, uint(xlen))
  5407. changed = true
  5408. }
  5409. if j >= len(v) {
  5410. v = append(v, 0)
  5411. changed = true
  5412. }
  5413. slh.ElemContainerState(j)
  5414. v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
  5415. }
  5416. if j < len(v) {
  5417. v = v[:uint(j)]
  5418. changed = true
  5419. } else if j == 0 && v == nil {
  5420. v = []int16{}
  5421. changed = true
  5422. }
  5423. slh.End()
  5424. return v, changed
  5425. }
  5426. func (fastpathT) DecSliceInt16N(v []int16, d *Decoder) {
  5427. slh, containerLenS := d.decSliceHelperStart()
  5428. if slh.IsNil {
  5429. return
  5430. }
  5431. if containerLenS == 0 {
  5432. slh.End()
  5433. return
  5434. }
  5435. hasLen := containerLenS > 0
  5436. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5437. if j >= len(v) {
  5438. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5439. return
  5440. }
  5441. slh.ElemContainerState(j)
  5442. v[uint(j)] = int16(chkOvf.IntV(d.d.DecodeInt64(), 16))
  5443. }
  5444. slh.End()
  5445. }
  5446. func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) {
  5447. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5448. vp := rv2i(rv).(*[]int32)
  5449. if v, changed := fastpathTV.DecSliceInt32Y(*vp, d); changed {
  5450. *vp = v
  5451. }
  5452. } else {
  5453. fastpathTV.DecSliceInt32N(rv2i(rv).([]int32), d)
  5454. }
  5455. }
  5456. func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) {
  5457. if v, changed := f.DecSliceInt32Y(*vp, d); changed {
  5458. *vp = v
  5459. }
  5460. }
  5461. func (fastpathT) DecSliceInt32Y(v []int32, d *Decoder) (_ []int32, changed bool) {
  5462. slh, containerLenS := d.decSliceHelperStart()
  5463. if slh.IsNil {
  5464. if v == nil {
  5465. return
  5466. }
  5467. return nil, true
  5468. }
  5469. if containerLenS == 0 {
  5470. if v == nil {
  5471. v = []int32{}
  5472. } else if len(v) != 0 {
  5473. v = v[:0]
  5474. }
  5475. slh.End()
  5476. return v, true
  5477. }
  5478. hasLen := containerLenS > 0
  5479. var xlen int
  5480. if hasLen {
  5481. if containerLenS > cap(v) {
  5482. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5483. if xlen <= cap(v) {
  5484. v = v[:uint(xlen)]
  5485. } else {
  5486. v = make([]int32, uint(xlen))
  5487. }
  5488. changed = true
  5489. } else if containerLenS != len(v) {
  5490. v = v[:containerLenS]
  5491. changed = true
  5492. }
  5493. }
  5494. var j int
  5495. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5496. if j == 0 && len(v) == 0 {
  5497. if hasLen {
  5498. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4)
  5499. } else {
  5500. xlen = 8
  5501. }
  5502. v = make([]int32, uint(xlen))
  5503. changed = true
  5504. }
  5505. if j >= len(v) {
  5506. v = append(v, 0)
  5507. changed = true
  5508. }
  5509. slh.ElemContainerState(j)
  5510. v[uint(j)] = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
  5511. }
  5512. if j < len(v) {
  5513. v = v[:uint(j)]
  5514. changed = true
  5515. } else if j == 0 && v == nil {
  5516. v = []int32{}
  5517. changed = true
  5518. }
  5519. slh.End()
  5520. return v, changed
  5521. }
  5522. func (fastpathT) DecSliceInt32N(v []int32, d *Decoder) {
  5523. slh, containerLenS := d.decSliceHelperStart()
  5524. if slh.IsNil {
  5525. return
  5526. }
  5527. if containerLenS == 0 {
  5528. slh.End()
  5529. return
  5530. }
  5531. hasLen := containerLenS > 0
  5532. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5533. if j >= len(v) {
  5534. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5535. return
  5536. }
  5537. slh.ElemContainerState(j)
  5538. v[uint(j)] = int32(chkOvf.IntV(d.d.DecodeInt64(), 32))
  5539. }
  5540. slh.End()
  5541. }
  5542. func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) {
  5543. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5544. vp := rv2i(rv).(*[]int64)
  5545. if v, changed := fastpathTV.DecSliceInt64Y(*vp, d); changed {
  5546. *vp = v
  5547. }
  5548. } else {
  5549. fastpathTV.DecSliceInt64N(rv2i(rv).([]int64), d)
  5550. }
  5551. }
  5552. func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) {
  5553. if v, changed := f.DecSliceInt64Y(*vp, d); changed {
  5554. *vp = v
  5555. }
  5556. }
  5557. func (fastpathT) DecSliceInt64Y(v []int64, d *Decoder) (_ []int64, changed bool) {
  5558. slh, containerLenS := d.decSliceHelperStart()
  5559. if slh.IsNil {
  5560. if v == nil {
  5561. return
  5562. }
  5563. return nil, true
  5564. }
  5565. if containerLenS == 0 {
  5566. if v == nil {
  5567. v = []int64{}
  5568. } else if len(v) != 0 {
  5569. v = v[:0]
  5570. }
  5571. slh.End()
  5572. return v, true
  5573. }
  5574. hasLen := containerLenS > 0
  5575. var xlen int
  5576. if hasLen {
  5577. if containerLenS > cap(v) {
  5578. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5579. if xlen <= cap(v) {
  5580. v = v[:uint(xlen)]
  5581. } else {
  5582. v = make([]int64, uint(xlen))
  5583. }
  5584. changed = true
  5585. } else if containerLenS != len(v) {
  5586. v = v[:containerLenS]
  5587. changed = true
  5588. }
  5589. }
  5590. var j int
  5591. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5592. if j == 0 && len(v) == 0 {
  5593. if hasLen {
  5594. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8)
  5595. } else {
  5596. xlen = 8
  5597. }
  5598. v = make([]int64, uint(xlen))
  5599. changed = true
  5600. }
  5601. if j >= len(v) {
  5602. v = append(v, 0)
  5603. changed = true
  5604. }
  5605. slh.ElemContainerState(j)
  5606. v[uint(j)] = d.d.DecodeInt64()
  5607. }
  5608. if j < len(v) {
  5609. v = v[:uint(j)]
  5610. changed = true
  5611. } else if j == 0 && v == nil {
  5612. v = []int64{}
  5613. changed = true
  5614. }
  5615. slh.End()
  5616. return v, changed
  5617. }
  5618. func (fastpathT) DecSliceInt64N(v []int64, d *Decoder) {
  5619. slh, containerLenS := d.decSliceHelperStart()
  5620. if slh.IsNil {
  5621. return
  5622. }
  5623. if containerLenS == 0 {
  5624. slh.End()
  5625. return
  5626. }
  5627. hasLen := containerLenS > 0
  5628. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5629. if j >= len(v) {
  5630. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5631. return
  5632. }
  5633. slh.ElemContainerState(j)
  5634. v[uint(j)] = d.d.DecodeInt64()
  5635. }
  5636. slh.End()
  5637. }
  5638. func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) {
  5639. if f.seq != seqTypeArray && rv.Kind() == reflect.Ptr {
  5640. vp := rv2i(rv).(*[]bool)
  5641. if v, changed := fastpathTV.DecSliceBoolY(*vp, d); changed {
  5642. *vp = v
  5643. }
  5644. } else {
  5645. fastpathTV.DecSliceBoolN(rv2i(rv).([]bool), d)
  5646. }
  5647. }
  5648. func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) {
  5649. if v, changed := f.DecSliceBoolY(*vp, d); changed {
  5650. *vp = v
  5651. }
  5652. }
  5653. func (fastpathT) DecSliceBoolY(v []bool, d *Decoder) (_ []bool, changed bool) {
  5654. slh, containerLenS := d.decSliceHelperStart()
  5655. if slh.IsNil {
  5656. if v == nil {
  5657. return
  5658. }
  5659. return nil, true
  5660. }
  5661. if containerLenS == 0 {
  5662. if v == nil {
  5663. v = []bool{}
  5664. } else if len(v) != 0 {
  5665. v = v[:0]
  5666. }
  5667. slh.End()
  5668. return v, true
  5669. }
  5670. hasLen := containerLenS > 0
  5671. var xlen int
  5672. if hasLen {
  5673. if containerLenS > cap(v) {
  5674. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5675. if xlen <= cap(v) {
  5676. v = v[:uint(xlen)]
  5677. } else {
  5678. v = make([]bool, uint(xlen))
  5679. }
  5680. changed = true
  5681. } else if containerLenS != len(v) {
  5682. v = v[:containerLenS]
  5683. changed = true
  5684. }
  5685. }
  5686. var j int
  5687. for j = 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5688. if j == 0 && len(v) == 0 {
  5689. if hasLen {
  5690. xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1)
  5691. } else {
  5692. xlen = 8
  5693. }
  5694. v = make([]bool, uint(xlen))
  5695. changed = true
  5696. }
  5697. if j >= len(v) {
  5698. v = append(v, false)
  5699. changed = true
  5700. }
  5701. slh.ElemContainerState(j)
  5702. v[uint(j)] = d.d.DecodeBool()
  5703. }
  5704. if j < len(v) {
  5705. v = v[:uint(j)]
  5706. changed = true
  5707. } else if j == 0 && v == nil {
  5708. v = []bool{}
  5709. changed = true
  5710. }
  5711. slh.End()
  5712. return v, changed
  5713. }
  5714. func (fastpathT) DecSliceBoolN(v []bool, d *Decoder) {
  5715. slh, containerLenS := d.decSliceHelperStart()
  5716. if slh.IsNil {
  5717. return
  5718. }
  5719. if containerLenS == 0 {
  5720. slh.End()
  5721. return
  5722. }
  5723. hasLen := containerLenS > 0
  5724. for j := 0; (hasLen && j < containerLenS) || !(hasLen || d.d.CheckBreak()); j++ {
  5725. if j >= len(v) {
  5726. fastpathDecArrayCannotExpand(slh, hasLen, len(v), j, containerLenS)
  5727. return
  5728. }
  5729. slh.ElemContainerState(j)
  5730. v[uint(j)] = d.d.DecodeBool()
  5731. }
  5732. slh.End()
  5733. }
  5734. func fastpathDecArrayCannotExpand(slh decSliceHelper, hasLen bool, lenv, j, containerLenS int) {
  5735. slh.d.arrayCannotExpand(lenv, j+1)
  5736. slh.ElemContainerState(j)
  5737. slh.d.swallow()
  5738. j++
  5739. for ; (hasLen && j < containerLenS) || !(hasLen || slh.d.d.CheckBreak()); j++ {
  5740. slh.ElemContainerState(j)
  5741. slh.d.swallow()
  5742. }
  5743. slh.End()
  5744. }
  5745. func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) {
  5746. containerLen := d.mapStart()
  5747. if containerLen == decContainerLenNil {
  5748. if rv.Kind() == reflect.Ptr {
  5749. *(rv2i(rv).(*map[string]interface{})) = nil
  5750. }
  5751. } else {
  5752. if rv.Kind() == reflect.Ptr {
  5753. vp, _ := rv2i(rv).(*map[string]interface{})
  5754. if *vp == nil {
  5755. *vp = make(map[string]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5756. }
  5757. if containerLen != 0 {
  5758. fastpathTV.DecMapStringIntfL(*vp, containerLen, d)
  5759. }
  5760. } else if containerLen != 0 {
  5761. fastpathTV.DecMapStringIntfL(rv2i(rv).(map[string]interface{}), containerLen, d)
  5762. }
  5763. d.mapEnd()
  5764. }
  5765. }
  5766. func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) {
  5767. containerLen := d.mapStart()
  5768. if containerLen == decContainerLenNil {
  5769. *vp = nil
  5770. } else {
  5771. if *vp == nil {
  5772. *vp = make(map[string]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5773. }
  5774. if containerLen != 0 {
  5775. f.DecMapStringIntfL(*vp, containerLen, d)
  5776. }
  5777. d.mapEnd()
  5778. }
  5779. }
  5780. func (fastpathT) DecMapStringIntfL(v map[string]interface{}, containerLen int, d *Decoder) {
  5781. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  5782. var mk string
  5783. var mv interface{}
  5784. hasLen := containerLen > 0
  5785. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5786. d.mapElemKey()
  5787. mk = string(d.d.DecodeStringAsBytes())
  5788. d.mapElemValue()
  5789. if mapGet {
  5790. mv = v[mk]
  5791. } else {
  5792. mv = nil
  5793. }
  5794. d.decode(&mv)
  5795. if v != nil {
  5796. v[mk] = mv
  5797. }
  5798. }
  5799. }
  5800. func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) {
  5801. containerLen := d.mapStart()
  5802. if containerLen == decContainerLenNil {
  5803. if rv.Kind() == reflect.Ptr {
  5804. *(rv2i(rv).(*map[string]string)) = nil
  5805. }
  5806. } else {
  5807. if rv.Kind() == reflect.Ptr {
  5808. vp, _ := rv2i(rv).(*map[string]string)
  5809. if *vp == nil {
  5810. *vp = make(map[string]string, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5811. }
  5812. if containerLen != 0 {
  5813. fastpathTV.DecMapStringStringL(*vp, containerLen, d)
  5814. }
  5815. } else if containerLen != 0 {
  5816. fastpathTV.DecMapStringStringL(rv2i(rv).(map[string]string), containerLen, d)
  5817. }
  5818. d.mapEnd()
  5819. }
  5820. }
  5821. func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) {
  5822. containerLen := d.mapStart()
  5823. if containerLen == decContainerLenNil {
  5824. *vp = nil
  5825. } else {
  5826. if *vp == nil {
  5827. *vp = make(map[string]string, decInferLen(containerLen, d.h.MaxInitLen, 32))
  5828. }
  5829. if containerLen != 0 {
  5830. f.DecMapStringStringL(*vp, containerLen, d)
  5831. }
  5832. d.mapEnd()
  5833. }
  5834. }
  5835. func (fastpathT) DecMapStringStringL(v map[string]string, containerLen int, d *Decoder) {
  5836. var mk string
  5837. var mv string
  5838. hasLen := containerLen > 0
  5839. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5840. d.mapElemKey()
  5841. mk = string(d.d.DecodeStringAsBytes())
  5842. d.mapElemValue()
  5843. mv = string(d.d.DecodeStringAsBytes())
  5844. if v != nil {
  5845. v[mk] = mv
  5846. }
  5847. }
  5848. }
  5849. func (d *Decoder) fastpathDecMapStringBytesR(f *codecFnInfo, rv reflect.Value) {
  5850. containerLen := d.mapStart()
  5851. if containerLen == decContainerLenNil {
  5852. if rv.Kind() == reflect.Ptr {
  5853. *(rv2i(rv).(*map[string][]byte)) = nil
  5854. }
  5855. } else {
  5856. if rv.Kind() == reflect.Ptr {
  5857. vp, _ := rv2i(rv).(*map[string][]byte)
  5858. if *vp == nil {
  5859. *vp = make(map[string][]byte, decInferLen(containerLen, d.h.MaxInitLen, 40))
  5860. }
  5861. if containerLen != 0 {
  5862. fastpathTV.DecMapStringBytesL(*vp, containerLen, d)
  5863. }
  5864. } else if containerLen != 0 {
  5865. fastpathTV.DecMapStringBytesL(rv2i(rv).(map[string][]byte), containerLen, d)
  5866. }
  5867. d.mapEnd()
  5868. }
  5869. }
  5870. func (f fastpathT) DecMapStringBytesX(vp *map[string][]byte, d *Decoder) {
  5871. containerLen := d.mapStart()
  5872. if containerLen == decContainerLenNil {
  5873. *vp = nil
  5874. } else {
  5875. if *vp == nil {
  5876. *vp = make(map[string][]byte, decInferLen(containerLen, d.h.MaxInitLen, 40))
  5877. }
  5878. if containerLen != 0 {
  5879. f.DecMapStringBytesL(*vp, containerLen, d)
  5880. }
  5881. d.mapEnd()
  5882. }
  5883. }
  5884. func (fastpathT) DecMapStringBytesL(v map[string][]byte, containerLen int, d *Decoder) {
  5885. mapGet := v != nil && !d.h.MapValueReset
  5886. var mk string
  5887. var mv []byte
  5888. hasLen := containerLen > 0
  5889. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5890. d.mapElemKey()
  5891. mk = string(d.d.DecodeStringAsBytes())
  5892. d.mapElemValue()
  5893. if mapGet {
  5894. mv = v[mk]
  5895. } else {
  5896. mv = nil
  5897. }
  5898. mv = d.d.DecodeBytes(mv, false)
  5899. if v != nil {
  5900. v[mk] = mv
  5901. }
  5902. }
  5903. }
  5904. func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) {
  5905. containerLen := d.mapStart()
  5906. if containerLen == decContainerLenNil {
  5907. if rv.Kind() == reflect.Ptr {
  5908. *(rv2i(rv).(*map[string]uint)) = nil
  5909. }
  5910. } else {
  5911. if rv.Kind() == reflect.Ptr {
  5912. vp, _ := rv2i(rv).(*map[string]uint)
  5913. if *vp == nil {
  5914. *vp = make(map[string]uint, decInferLen(containerLen, d.h.MaxInitLen, 24))
  5915. }
  5916. if containerLen != 0 {
  5917. fastpathTV.DecMapStringUintL(*vp, containerLen, d)
  5918. }
  5919. } else if containerLen != 0 {
  5920. fastpathTV.DecMapStringUintL(rv2i(rv).(map[string]uint), containerLen, d)
  5921. }
  5922. d.mapEnd()
  5923. }
  5924. }
  5925. func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) {
  5926. containerLen := d.mapStart()
  5927. if containerLen == decContainerLenNil {
  5928. *vp = nil
  5929. } else {
  5930. if *vp == nil {
  5931. *vp = make(map[string]uint, decInferLen(containerLen, d.h.MaxInitLen, 24))
  5932. }
  5933. if containerLen != 0 {
  5934. f.DecMapStringUintL(*vp, containerLen, d)
  5935. }
  5936. d.mapEnd()
  5937. }
  5938. }
  5939. func (fastpathT) DecMapStringUintL(v map[string]uint, containerLen int, d *Decoder) {
  5940. var mk string
  5941. var mv uint
  5942. hasLen := containerLen > 0
  5943. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5944. d.mapElemKey()
  5945. mk = string(d.d.DecodeStringAsBytes())
  5946. d.mapElemValue()
  5947. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  5948. if v != nil {
  5949. v[mk] = mv
  5950. }
  5951. }
  5952. }
  5953. func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) {
  5954. containerLen := d.mapStart()
  5955. if containerLen == decContainerLenNil {
  5956. if rv.Kind() == reflect.Ptr {
  5957. *(rv2i(rv).(*map[string]uint8)) = nil
  5958. }
  5959. } else {
  5960. if rv.Kind() == reflect.Ptr {
  5961. vp, _ := rv2i(rv).(*map[string]uint8)
  5962. if *vp == nil {
  5963. *vp = make(map[string]uint8, decInferLen(containerLen, d.h.MaxInitLen, 17))
  5964. }
  5965. if containerLen != 0 {
  5966. fastpathTV.DecMapStringUint8L(*vp, containerLen, d)
  5967. }
  5968. } else if containerLen != 0 {
  5969. fastpathTV.DecMapStringUint8L(rv2i(rv).(map[string]uint8), containerLen, d)
  5970. }
  5971. d.mapEnd()
  5972. }
  5973. }
  5974. func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) {
  5975. containerLen := d.mapStart()
  5976. if containerLen == decContainerLenNil {
  5977. *vp = nil
  5978. } else {
  5979. if *vp == nil {
  5980. *vp = make(map[string]uint8, decInferLen(containerLen, d.h.MaxInitLen, 17))
  5981. }
  5982. if containerLen != 0 {
  5983. f.DecMapStringUint8L(*vp, containerLen, d)
  5984. }
  5985. d.mapEnd()
  5986. }
  5987. }
  5988. func (fastpathT) DecMapStringUint8L(v map[string]uint8, containerLen int, d *Decoder) {
  5989. var mk string
  5990. var mv uint8
  5991. hasLen := containerLen > 0
  5992. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  5993. d.mapElemKey()
  5994. mk = string(d.d.DecodeStringAsBytes())
  5995. d.mapElemValue()
  5996. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  5997. if v != nil {
  5998. v[mk] = mv
  5999. }
  6000. }
  6001. }
  6002. func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) {
  6003. containerLen := d.mapStart()
  6004. if containerLen == decContainerLenNil {
  6005. if rv.Kind() == reflect.Ptr {
  6006. *(rv2i(rv).(*map[string]uint64)) = nil
  6007. }
  6008. } else {
  6009. if rv.Kind() == reflect.Ptr {
  6010. vp, _ := rv2i(rv).(*map[string]uint64)
  6011. if *vp == nil {
  6012. *vp = make(map[string]uint64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6013. }
  6014. if containerLen != 0 {
  6015. fastpathTV.DecMapStringUint64L(*vp, containerLen, d)
  6016. }
  6017. } else if containerLen != 0 {
  6018. fastpathTV.DecMapStringUint64L(rv2i(rv).(map[string]uint64), containerLen, d)
  6019. }
  6020. d.mapEnd()
  6021. }
  6022. }
  6023. func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) {
  6024. containerLen := d.mapStart()
  6025. if containerLen == decContainerLenNil {
  6026. *vp = nil
  6027. } else {
  6028. if *vp == nil {
  6029. *vp = make(map[string]uint64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6030. }
  6031. if containerLen != 0 {
  6032. f.DecMapStringUint64L(*vp, containerLen, d)
  6033. }
  6034. d.mapEnd()
  6035. }
  6036. }
  6037. func (fastpathT) DecMapStringUint64L(v map[string]uint64, containerLen int, d *Decoder) {
  6038. var mk string
  6039. var mv uint64
  6040. hasLen := containerLen > 0
  6041. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6042. d.mapElemKey()
  6043. mk = string(d.d.DecodeStringAsBytes())
  6044. d.mapElemValue()
  6045. mv = d.d.DecodeUint64()
  6046. if v != nil {
  6047. v[mk] = mv
  6048. }
  6049. }
  6050. }
  6051. func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) {
  6052. containerLen := d.mapStart()
  6053. if containerLen == decContainerLenNil {
  6054. if rv.Kind() == reflect.Ptr {
  6055. *(rv2i(rv).(*map[string]int)) = nil
  6056. }
  6057. } else {
  6058. if rv.Kind() == reflect.Ptr {
  6059. vp, _ := rv2i(rv).(*map[string]int)
  6060. if *vp == nil {
  6061. *vp = make(map[string]int, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6062. }
  6063. if containerLen != 0 {
  6064. fastpathTV.DecMapStringIntL(*vp, containerLen, d)
  6065. }
  6066. } else if containerLen != 0 {
  6067. fastpathTV.DecMapStringIntL(rv2i(rv).(map[string]int), containerLen, d)
  6068. }
  6069. d.mapEnd()
  6070. }
  6071. }
  6072. func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) {
  6073. containerLen := d.mapStart()
  6074. if containerLen == decContainerLenNil {
  6075. *vp = nil
  6076. } else {
  6077. if *vp == nil {
  6078. *vp = make(map[string]int, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6079. }
  6080. if containerLen != 0 {
  6081. f.DecMapStringIntL(*vp, containerLen, d)
  6082. }
  6083. d.mapEnd()
  6084. }
  6085. }
  6086. func (fastpathT) DecMapStringIntL(v map[string]int, containerLen int, d *Decoder) {
  6087. var mk string
  6088. var mv int
  6089. hasLen := containerLen > 0
  6090. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6091. d.mapElemKey()
  6092. mk = string(d.d.DecodeStringAsBytes())
  6093. d.mapElemValue()
  6094. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  6095. if v != nil {
  6096. v[mk] = mv
  6097. }
  6098. }
  6099. }
  6100. func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) {
  6101. containerLen := d.mapStart()
  6102. if containerLen == decContainerLenNil {
  6103. if rv.Kind() == reflect.Ptr {
  6104. *(rv2i(rv).(*map[string]int64)) = nil
  6105. }
  6106. } else {
  6107. if rv.Kind() == reflect.Ptr {
  6108. vp, _ := rv2i(rv).(*map[string]int64)
  6109. if *vp == nil {
  6110. *vp = make(map[string]int64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6111. }
  6112. if containerLen != 0 {
  6113. fastpathTV.DecMapStringInt64L(*vp, containerLen, d)
  6114. }
  6115. } else if containerLen != 0 {
  6116. fastpathTV.DecMapStringInt64L(rv2i(rv).(map[string]int64), containerLen, d)
  6117. }
  6118. d.mapEnd()
  6119. }
  6120. }
  6121. func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) {
  6122. containerLen := d.mapStart()
  6123. if containerLen == decContainerLenNil {
  6124. *vp = nil
  6125. } else {
  6126. if *vp == nil {
  6127. *vp = make(map[string]int64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6128. }
  6129. if containerLen != 0 {
  6130. f.DecMapStringInt64L(*vp, containerLen, d)
  6131. }
  6132. d.mapEnd()
  6133. }
  6134. }
  6135. func (fastpathT) DecMapStringInt64L(v map[string]int64, containerLen int, d *Decoder) {
  6136. var mk string
  6137. var mv int64
  6138. hasLen := containerLen > 0
  6139. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6140. d.mapElemKey()
  6141. mk = string(d.d.DecodeStringAsBytes())
  6142. d.mapElemValue()
  6143. mv = d.d.DecodeInt64()
  6144. if v != nil {
  6145. v[mk] = mv
  6146. }
  6147. }
  6148. }
  6149. func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) {
  6150. containerLen := d.mapStart()
  6151. if containerLen == decContainerLenNil {
  6152. if rv.Kind() == reflect.Ptr {
  6153. *(rv2i(rv).(*map[string]float32)) = nil
  6154. }
  6155. } else {
  6156. if rv.Kind() == reflect.Ptr {
  6157. vp, _ := rv2i(rv).(*map[string]float32)
  6158. if *vp == nil {
  6159. *vp = make(map[string]float32, decInferLen(containerLen, d.h.MaxInitLen, 20))
  6160. }
  6161. if containerLen != 0 {
  6162. fastpathTV.DecMapStringFloat32L(*vp, containerLen, d)
  6163. }
  6164. } else if containerLen != 0 {
  6165. fastpathTV.DecMapStringFloat32L(rv2i(rv).(map[string]float32), containerLen, d)
  6166. }
  6167. d.mapEnd()
  6168. }
  6169. }
  6170. func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) {
  6171. containerLen := d.mapStart()
  6172. if containerLen == decContainerLenNil {
  6173. *vp = nil
  6174. } else {
  6175. if *vp == nil {
  6176. *vp = make(map[string]float32, decInferLen(containerLen, d.h.MaxInitLen, 20))
  6177. }
  6178. if containerLen != 0 {
  6179. f.DecMapStringFloat32L(*vp, containerLen, d)
  6180. }
  6181. d.mapEnd()
  6182. }
  6183. }
  6184. func (fastpathT) DecMapStringFloat32L(v map[string]float32, containerLen int, d *Decoder) {
  6185. var mk string
  6186. var mv float32
  6187. hasLen := containerLen > 0
  6188. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6189. d.mapElemKey()
  6190. mk = string(d.d.DecodeStringAsBytes())
  6191. d.mapElemValue()
  6192. mv = float32(d.decodeFloat32())
  6193. if v != nil {
  6194. v[mk] = mv
  6195. }
  6196. }
  6197. }
  6198. func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
  6199. containerLen := d.mapStart()
  6200. if containerLen == decContainerLenNil {
  6201. if rv.Kind() == reflect.Ptr {
  6202. *(rv2i(rv).(*map[string]float64)) = nil
  6203. }
  6204. } else {
  6205. if rv.Kind() == reflect.Ptr {
  6206. vp, _ := rv2i(rv).(*map[string]float64)
  6207. if *vp == nil {
  6208. *vp = make(map[string]float64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6209. }
  6210. if containerLen != 0 {
  6211. fastpathTV.DecMapStringFloat64L(*vp, containerLen, d)
  6212. }
  6213. } else if containerLen != 0 {
  6214. fastpathTV.DecMapStringFloat64L(rv2i(rv).(map[string]float64), containerLen, d)
  6215. }
  6216. d.mapEnd()
  6217. }
  6218. }
  6219. func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) {
  6220. containerLen := d.mapStart()
  6221. if containerLen == decContainerLenNil {
  6222. *vp = nil
  6223. } else {
  6224. if *vp == nil {
  6225. *vp = make(map[string]float64, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6226. }
  6227. if containerLen != 0 {
  6228. f.DecMapStringFloat64L(*vp, containerLen, d)
  6229. }
  6230. d.mapEnd()
  6231. }
  6232. }
  6233. func (fastpathT) DecMapStringFloat64L(v map[string]float64, containerLen int, d *Decoder) {
  6234. var mk string
  6235. var mv float64
  6236. hasLen := containerLen > 0
  6237. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6238. d.mapElemKey()
  6239. mk = string(d.d.DecodeStringAsBytes())
  6240. d.mapElemValue()
  6241. mv = d.d.DecodeFloat64()
  6242. if v != nil {
  6243. v[mk] = mv
  6244. }
  6245. }
  6246. }
  6247. func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) {
  6248. containerLen := d.mapStart()
  6249. if containerLen == decContainerLenNil {
  6250. if rv.Kind() == reflect.Ptr {
  6251. *(rv2i(rv).(*map[string]bool)) = nil
  6252. }
  6253. } else {
  6254. if rv.Kind() == reflect.Ptr {
  6255. vp, _ := rv2i(rv).(*map[string]bool)
  6256. if *vp == nil {
  6257. *vp = make(map[string]bool, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6258. }
  6259. if containerLen != 0 {
  6260. fastpathTV.DecMapStringBoolL(*vp, containerLen, d)
  6261. }
  6262. } else if containerLen != 0 {
  6263. fastpathTV.DecMapStringBoolL(rv2i(rv).(map[string]bool), containerLen, d)
  6264. }
  6265. d.mapEnd()
  6266. }
  6267. }
  6268. func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) {
  6269. containerLen := d.mapStart()
  6270. if containerLen == decContainerLenNil {
  6271. *vp = nil
  6272. } else {
  6273. if *vp == nil {
  6274. *vp = make(map[string]bool, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6275. }
  6276. if containerLen != 0 {
  6277. f.DecMapStringBoolL(*vp, containerLen, d)
  6278. }
  6279. d.mapEnd()
  6280. }
  6281. }
  6282. func (fastpathT) DecMapStringBoolL(v map[string]bool, containerLen int, d *Decoder) {
  6283. var mk string
  6284. var mv bool
  6285. hasLen := containerLen > 0
  6286. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6287. d.mapElemKey()
  6288. mk = string(d.d.DecodeStringAsBytes())
  6289. d.mapElemValue()
  6290. mv = d.d.DecodeBool()
  6291. if v != nil {
  6292. v[mk] = mv
  6293. }
  6294. }
  6295. }
  6296. func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) {
  6297. containerLen := d.mapStart()
  6298. if containerLen == decContainerLenNil {
  6299. if rv.Kind() == reflect.Ptr {
  6300. *(rv2i(rv).(*map[uint]interface{})) = nil
  6301. }
  6302. } else {
  6303. if rv.Kind() == reflect.Ptr {
  6304. vp, _ := rv2i(rv).(*map[uint]interface{})
  6305. if *vp == nil {
  6306. *vp = make(map[uint]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6307. }
  6308. if containerLen != 0 {
  6309. fastpathTV.DecMapUintIntfL(*vp, containerLen, d)
  6310. }
  6311. } else if containerLen != 0 {
  6312. fastpathTV.DecMapUintIntfL(rv2i(rv).(map[uint]interface{}), containerLen, d)
  6313. }
  6314. d.mapEnd()
  6315. }
  6316. }
  6317. func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) {
  6318. containerLen := d.mapStart()
  6319. if containerLen == decContainerLenNil {
  6320. *vp = nil
  6321. } else {
  6322. if *vp == nil {
  6323. *vp = make(map[uint]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6324. }
  6325. if containerLen != 0 {
  6326. f.DecMapUintIntfL(*vp, containerLen, d)
  6327. }
  6328. d.mapEnd()
  6329. }
  6330. }
  6331. func (fastpathT) DecMapUintIntfL(v map[uint]interface{}, containerLen int, d *Decoder) {
  6332. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  6333. var mk uint
  6334. var mv interface{}
  6335. hasLen := containerLen > 0
  6336. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6337. d.mapElemKey()
  6338. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6339. d.mapElemValue()
  6340. if mapGet {
  6341. mv = v[mk]
  6342. } else {
  6343. mv = nil
  6344. }
  6345. d.decode(&mv)
  6346. if v != nil {
  6347. v[mk] = mv
  6348. }
  6349. }
  6350. }
  6351. func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) {
  6352. containerLen := d.mapStart()
  6353. if containerLen == decContainerLenNil {
  6354. if rv.Kind() == reflect.Ptr {
  6355. *(rv2i(rv).(*map[uint]string)) = nil
  6356. }
  6357. } else {
  6358. if rv.Kind() == reflect.Ptr {
  6359. vp, _ := rv2i(rv).(*map[uint]string)
  6360. if *vp == nil {
  6361. *vp = make(map[uint]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6362. }
  6363. if containerLen != 0 {
  6364. fastpathTV.DecMapUintStringL(*vp, containerLen, d)
  6365. }
  6366. } else if containerLen != 0 {
  6367. fastpathTV.DecMapUintStringL(rv2i(rv).(map[uint]string), containerLen, d)
  6368. }
  6369. d.mapEnd()
  6370. }
  6371. }
  6372. func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) {
  6373. containerLen := d.mapStart()
  6374. if containerLen == decContainerLenNil {
  6375. *vp = nil
  6376. } else {
  6377. if *vp == nil {
  6378. *vp = make(map[uint]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  6379. }
  6380. if containerLen != 0 {
  6381. f.DecMapUintStringL(*vp, containerLen, d)
  6382. }
  6383. d.mapEnd()
  6384. }
  6385. }
  6386. func (fastpathT) DecMapUintStringL(v map[uint]string, containerLen int, d *Decoder) {
  6387. var mk uint
  6388. var mv string
  6389. hasLen := containerLen > 0
  6390. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6391. d.mapElemKey()
  6392. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6393. d.mapElemValue()
  6394. mv = string(d.d.DecodeStringAsBytes())
  6395. if v != nil {
  6396. v[mk] = mv
  6397. }
  6398. }
  6399. }
  6400. func (d *Decoder) fastpathDecMapUintBytesR(f *codecFnInfo, rv reflect.Value) {
  6401. containerLen := d.mapStart()
  6402. if containerLen == decContainerLenNil {
  6403. if rv.Kind() == reflect.Ptr {
  6404. *(rv2i(rv).(*map[uint][]byte)) = nil
  6405. }
  6406. } else {
  6407. if rv.Kind() == reflect.Ptr {
  6408. vp, _ := rv2i(rv).(*map[uint][]byte)
  6409. if *vp == nil {
  6410. *vp = make(map[uint][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  6411. }
  6412. if containerLen != 0 {
  6413. fastpathTV.DecMapUintBytesL(*vp, containerLen, d)
  6414. }
  6415. } else if containerLen != 0 {
  6416. fastpathTV.DecMapUintBytesL(rv2i(rv).(map[uint][]byte), containerLen, d)
  6417. }
  6418. d.mapEnd()
  6419. }
  6420. }
  6421. func (f fastpathT) DecMapUintBytesX(vp *map[uint][]byte, d *Decoder) {
  6422. containerLen := d.mapStart()
  6423. if containerLen == decContainerLenNil {
  6424. *vp = nil
  6425. } else {
  6426. if *vp == nil {
  6427. *vp = make(map[uint][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  6428. }
  6429. if containerLen != 0 {
  6430. f.DecMapUintBytesL(*vp, containerLen, d)
  6431. }
  6432. d.mapEnd()
  6433. }
  6434. }
  6435. func (fastpathT) DecMapUintBytesL(v map[uint][]byte, containerLen int, d *Decoder) {
  6436. mapGet := v != nil && !d.h.MapValueReset
  6437. var mk uint
  6438. var mv []byte
  6439. hasLen := containerLen > 0
  6440. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6441. d.mapElemKey()
  6442. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6443. d.mapElemValue()
  6444. if mapGet {
  6445. mv = v[mk]
  6446. } else {
  6447. mv = nil
  6448. }
  6449. mv = d.d.DecodeBytes(mv, false)
  6450. if v != nil {
  6451. v[mk] = mv
  6452. }
  6453. }
  6454. }
  6455. func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) {
  6456. containerLen := d.mapStart()
  6457. if containerLen == decContainerLenNil {
  6458. if rv.Kind() == reflect.Ptr {
  6459. *(rv2i(rv).(*map[uint]uint)) = nil
  6460. }
  6461. } else {
  6462. if rv.Kind() == reflect.Ptr {
  6463. vp, _ := rv2i(rv).(*map[uint]uint)
  6464. if *vp == nil {
  6465. *vp = make(map[uint]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6466. }
  6467. if containerLen != 0 {
  6468. fastpathTV.DecMapUintUintL(*vp, containerLen, d)
  6469. }
  6470. } else if containerLen != 0 {
  6471. fastpathTV.DecMapUintUintL(rv2i(rv).(map[uint]uint), containerLen, d)
  6472. }
  6473. d.mapEnd()
  6474. }
  6475. }
  6476. func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) {
  6477. containerLen := d.mapStart()
  6478. if containerLen == decContainerLenNil {
  6479. *vp = nil
  6480. } else {
  6481. if *vp == nil {
  6482. *vp = make(map[uint]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6483. }
  6484. if containerLen != 0 {
  6485. f.DecMapUintUintL(*vp, containerLen, d)
  6486. }
  6487. d.mapEnd()
  6488. }
  6489. }
  6490. func (fastpathT) DecMapUintUintL(v map[uint]uint, containerLen int, d *Decoder) {
  6491. var mk uint
  6492. var mv uint
  6493. hasLen := containerLen > 0
  6494. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6495. d.mapElemKey()
  6496. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6497. d.mapElemValue()
  6498. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6499. if v != nil {
  6500. v[mk] = mv
  6501. }
  6502. }
  6503. }
  6504. func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) {
  6505. containerLen := d.mapStart()
  6506. if containerLen == decContainerLenNil {
  6507. if rv.Kind() == reflect.Ptr {
  6508. *(rv2i(rv).(*map[uint]uint8)) = nil
  6509. }
  6510. } else {
  6511. if rv.Kind() == reflect.Ptr {
  6512. vp, _ := rv2i(rv).(*map[uint]uint8)
  6513. if *vp == nil {
  6514. *vp = make(map[uint]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6515. }
  6516. if containerLen != 0 {
  6517. fastpathTV.DecMapUintUint8L(*vp, containerLen, d)
  6518. }
  6519. } else if containerLen != 0 {
  6520. fastpathTV.DecMapUintUint8L(rv2i(rv).(map[uint]uint8), containerLen, d)
  6521. }
  6522. d.mapEnd()
  6523. }
  6524. }
  6525. func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) {
  6526. containerLen := d.mapStart()
  6527. if containerLen == decContainerLenNil {
  6528. *vp = nil
  6529. } else {
  6530. if *vp == nil {
  6531. *vp = make(map[uint]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6532. }
  6533. if containerLen != 0 {
  6534. f.DecMapUintUint8L(*vp, containerLen, d)
  6535. }
  6536. d.mapEnd()
  6537. }
  6538. }
  6539. func (fastpathT) DecMapUintUint8L(v map[uint]uint8, containerLen int, d *Decoder) {
  6540. var mk uint
  6541. var mv uint8
  6542. hasLen := containerLen > 0
  6543. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6544. d.mapElemKey()
  6545. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6546. d.mapElemValue()
  6547. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6548. if v != nil {
  6549. v[mk] = mv
  6550. }
  6551. }
  6552. }
  6553. func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) {
  6554. containerLen := d.mapStart()
  6555. if containerLen == decContainerLenNil {
  6556. if rv.Kind() == reflect.Ptr {
  6557. *(rv2i(rv).(*map[uint]uint64)) = nil
  6558. }
  6559. } else {
  6560. if rv.Kind() == reflect.Ptr {
  6561. vp, _ := rv2i(rv).(*map[uint]uint64)
  6562. if *vp == nil {
  6563. *vp = make(map[uint]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6564. }
  6565. if containerLen != 0 {
  6566. fastpathTV.DecMapUintUint64L(*vp, containerLen, d)
  6567. }
  6568. } else if containerLen != 0 {
  6569. fastpathTV.DecMapUintUint64L(rv2i(rv).(map[uint]uint64), containerLen, d)
  6570. }
  6571. d.mapEnd()
  6572. }
  6573. }
  6574. func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) {
  6575. containerLen := d.mapStart()
  6576. if containerLen == decContainerLenNil {
  6577. *vp = nil
  6578. } else {
  6579. if *vp == nil {
  6580. *vp = make(map[uint]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6581. }
  6582. if containerLen != 0 {
  6583. f.DecMapUintUint64L(*vp, containerLen, d)
  6584. }
  6585. d.mapEnd()
  6586. }
  6587. }
  6588. func (fastpathT) DecMapUintUint64L(v map[uint]uint64, containerLen int, d *Decoder) {
  6589. var mk uint
  6590. var mv uint64
  6591. hasLen := containerLen > 0
  6592. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6593. d.mapElemKey()
  6594. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6595. d.mapElemValue()
  6596. mv = d.d.DecodeUint64()
  6597. if v != nil {
  6598. v[mk] = mv
  6599. }
  6600. }
  6601. }
  6602. func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) {
  6603. containerLen := d.mapStart()
  6604. if containerLen == decContainerLenNil {
  6605. if rv.Kind() == reflect.Ptr {
  6606. *(rv2i(rv).(*map[uint]int)) = nil
  6607. }
  6608. } else {
  6609. if rv.Kind() == reflect.Ptr {
  6610. vp, _ := rv2i(rv).(*map[uint]int)
  6611. if *vp == nil {
  6612. *vp = make(map[uint]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6613. }
  6614. if containerLen != 0 {
  6615. fastpathTV.DecMapUintIntL(*vp, containerLen, d)
  6616. }
  6617. } else if containerLen != 0 {
  6618. fastpathTV.DecMapUintIntL(rv2i(rv).(map[uint]int), containerLen, d)
  6619. }
  6620. d.mapEnd()
  6621. }
  6622. }
  6623. func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) {
  6624. containerLen := d.mapStart()
  6625. if containerLen == decContainerLenNil {
  6626. *vp = nil
  6627. } else {
  6628. if *vp == nil {
  6629. *vp = make(map[uint]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6630. }
  6631. if containerLen != 0 {
  6632. f.DecMapUintIntL(*vp, containerLen, d)
  6633. }
  6634. d.mapEnd()
  6635. }
  6636. }
  6637. func (fastpathT) DecMapUintIntL(v map[uint]int, containerLen int, d *Decoder) {
  6638. var mk uint
  6639. var mv int
  6640. hasLen := containerLen > 0
  6641. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6642. d.mapElemKey()
  6643. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6644. d.mapElemValue()
  6645. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  6646. if v != nil {
  6647. v[mk] = mv
  6648. }
  6649. }
  6650. }
  6651. func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) {
  6652. containerLen := d.mapStart()
  6653. if containerLen == decContainerLenNil {
  6654. if rv.Kind() == reflect.Ptr {
  6655. *(rv2i(rv).(*map[uint]int64)) = nil
  6656. }
  6657. } else {
  6658. if rv.Kind() == reflect.Ptr {
  6659. vp, _ := rv2i(rv).(*map[uint]int64)
  6660. if *vp == nil {
  6661. *vp = make(map[uint]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6662. }
  6663. if containerLen != 0 {
  6664. fastpathTV.DecMapUintInt64L(*vp, containerLen, d)
  6665. }
  6666. } else if containerLen != 0 {
  6667. fastpathTV.DecMapUintInt64L(rv2i(rv).(map[uint]int64), containerLen, d)
  6668. }
  6669. d.mapEnd()
  6670. }
  6671. }
  6672. func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) {
  6673. containerLen := d.mapStart()
  6674. if containerLen == decContainerLenNil {
  6675. *vp = nil
  6676. } else {
  6677. if *vp == nil {
  6678. *vp = make(map[uint]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6679. }
  6680. if containerLen != 0 {
  6681. f.DecMapUintInt64L(*vp, containerLen, d)
  6682. }
  6683. d.mapEnd()
  6684. }
  6685. }
  6686. func (fastpathT) DecMapUintInt64L(v map[uint]int64, containerLen int, d *Decoder) {
  6687. var mk uint
  6688. var mv int64
  6689. hasLen := containerLen > 0
  6690. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6691. d.mapElemKey()
  6692. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6693. d.mapElemValue()
  6694. mv = d.d.DecodeInt64()
  6695. if v != nil {
  6696. v[mk] = mv
  6697. }
  6698. }
  6699. }
  6700. func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) {
  6701. containerLen := d.mapStart()
  6702. if containerLen == decContainerLenNil {
  6703. if rv.Kind() == reflect.Ptr {
  6704. *(rv2i(rv).(*map[uint]float32)) = nil
  6705. }
  6706. } else {
  6707. if rv.Kind() == reflect.Ptr {
  6708. vp, _ := rv2i(rv).(*map[uint]float32)
  6709. if *vp == nil {
  6710. *vp = make(map[uint]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  6711. }
  6712. if containerLen != 0 {
  6713. fastpathTV.DecMapUintFloat32L(*vp, containerLen, d)
  6714. }
  6715. } else if containerLen != 0 {
  6716. fastpathTV.DecMapUintFloat32L(rv2i(rv).(map[uint]float32), containerLen, d)
  6717. }
  6718. d.mapEnd()
  6719. }
  6720. }
  6721. func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) {
  6722. containerLen := d.mapStart()
  6723. if containerLen == decContainerLenNil {
  6724. *vp = nil
  6725. } else {
  6726. if *vp == nil {
  6727. *vp = make(map[uint]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  6728. }
  6729. if containerLen != 0 {
  6730. f.DecMapUintFloat32L(*vp, containerLen, d)
  6731. }
  6732. d.mapEnd()
  6733. }
  6734. }
  6735. func (fastpathT) DecMapUintFloat32L(v map[uint]float32, containerLen int, d *Decoder) {
  6736. var mk uint
  6737. var mv float32
  6738. hasLen := containerLen > 0
  6739. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6740. d.mapElemKey()
  6741. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6742. d.mapElemValue()
  6743. mv = float32(d.decodeFloat32())
  6744. if v != nil {
  6745. v[mk] = mv
  6746. }
  6747. }
  6748. }
  6749. func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) {
  6750. containerLen := d.mapStart()
  6751. if containerLen == decContainerLenNil {
  6752. if rv.Kind() == reflect.Ptr {
  6753. *(rv2i(rv).(*map[uint]float64)) = nil
  6754. }
  6755. } else {
  6756. if rv.Kind() == reflect.Ptr {
  6757. vp, _ := rv2i(rv).(*map[uint]float64)
  6758. if *vp == nil {
  6759. *vp = make(map[uint]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6760. }
  6761. if containerLen != 0 {
  6762. fastpathTV.DecMapUintFloat64L(*vp, containerLen, d)
  6763. }
  6764. } else if containerLen != 0 {
  6765. fastpathTV.DecMapUintFloat64L(rv2i(rv).(map[uint]float64), containerLen, d)
  6766. }
  6767. d.mapEnd()
  6768. }
  6769. }
  6770. func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) {
  6771. containerLen := d.mapStart()
  6772. if containerLen == decContainerLenNil {
  6773. *vp = nil
  6774. } else {
  6775. if *vp == nil {
  6776. *vp = make(map[uint]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  6777. }
  6778. if containerLen != 0 {
  6779. f.DecMapUintFloat64L(*vp, containerLen, d)
  6780. }
  6781. d.mapEnd()
  6782. }
  6783. }
  6784. func (fastpathT) DecMapUintFloat64L(v map[uint]float64, containerLen int, d *Decoder) {
  6785. var mk uint
  6786. var mv float64
  6787. hasLen := containerLen > 0
  6788. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6789. d.mapElemKey()
  6790. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6791. d.mapElemValue()
  6792. mv = d.d.DecodeFloat64()
  6793. if v != nil {
  6794. v[mk] = mv
  6795. }
  6796. }
  6797. }
  6798. func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) {
  6799. containerLen := d.mapStart()
  6800. if containerLen == decContainerLenNil {
  6801. if rv.Kind() == reflect.Ptr {
  6802. *(rv2i(rv).(*map[uint]bool)) = nil
  6803. }
  6804. } else {
  6805. if rv.Kind() == reflect.Ptr {
  6806. vp, _ := rv2i(rv).(*map[uint]bool)
  6807. if *vp == nil {
  6808. *vp = make(map[uint]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6809. }
  6810. if containerLen != 0 {
  6811. fastpathTV.DecMapUintBoolL(*vp, containerLen, d)
  6812. }
  6813. } else if containerLen != 0 {
  6814. fastpathTV.DecMapUintBoolL(rv2i(rv).(map[uint]bool), containerLen, d)
  6815. }
  6816. d.mapEnd()
  6817. }
  6818. }
  6819. func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) {
  6820. containerLen := d.mapStart()
  6821. if containerLen == decContainerLenNil {
  6822. *vp = nil
  6823. } else {
  6824. if *vp == nil {
  6825. *vp = make(map[uint]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  6826. }
  6827. if containerLen != 0 {
  6828. f.DecMapUintBoolL(*vp, containerLen, d)
  6829. }
  6830. d.mapEnd()
  6831. }
  6832. }
  6833. func (fastpathT) DecMapUintBoolL(v map[uint]bool, containerLen int, d *Decoder) {
  6834. var mk uint
  6835. var mv bool
  6836. hasLen := containerLen > 0
  6837. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6838. d.mapElemKey()
  6839. mk = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  6840. d.mapElemValue()
  6841. mv = d.d.DecodeBool()
  6842. if v != nil {
  6843. v[mk] = mv
  6844. }
  6845. }
  6846. }
  6847. func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) {
  6848. containerLen := d.mapStart()
  6849. if containerLen == decContainerLenNil {
  6850. if rv.Kind() == reflect.Ptr {
  6851. *(rv2i(rv).(*map[uint8]interface{})) = nil
  6852. }
  6853. } else {
  6854. if rv.Kind() == reflect.Ptr {
  6855. vp, _ := rv2i(rv).(*map[uint8]interface{})
  6856. if *vp == nil {
  6857. *vp = make(map[uint8]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6858. }
  6859. if containerLen != 0 {
  6860. fastpathTV.DecMapUint8IntfL(*vp, containerLen, d)
  6861. }
  6862. } else if containerLen != 0 {
  6863. fastpathTV.DecMapUint8IntfL(rv2i(rv).(map[uint8]interface{}), containerLen, d)
  6864. }
  6865. d.mapEnd()
  6866. }
  6867. }
  6868. func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) {
  6869. containerLen := d.mapStart()
  6870. if containerLen == decContainerLenNil {
  6871. *vp = nil
  6872. } else {
  6873. if *vp == nil {
  6874. *vp = make(map[uint8]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6875. }
  6876. if containerLen != 0 {
  6877. f.DecMapUint8IntfL(*vp, containerLen, d)
  6878. }
  6879. d.mapEnd()
  6880. }
  6881. }
  6882. func (fastpathT) DecMapUint8IntfL(v map[uint8]interface{}, containerLen int, d *Decoder) {
  6883. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  6884. var mk uint8
  6885. var mv interface{}
  6886. hasLen := containerLen > 0
  6887. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6888. d.mapElemKey()
  6889. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6890. d.mapElemValue()
  6891. if mapGet {
  6892. mv = v[mk]
  6893. } else {
  6894. mv = nil
  6895. }
  6896. d.decode(&mv)
  6897. if v != nil {
  6898. v[mk] = mv
  6899. }
  6900. }
  6901. }
  6902. func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) {
  6903. containerLen := d.mapStart()
  6904. if containerLen == decContainerLenNil {
  6905. if rv.Kind() == reflect.Ptr {
  6906. *(rv2i(rv).(*map[uint8]string)) = nil
  6907. }
  6908. } else {
  6909. if rv.Kind() == reflect.Ptr {
  6910. vp, _ := rv2i(rv).(*map[uint8]string)
  6911. if *vp == nil {
  6912. *vp = make(map[uint8]string, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6913. }
  6914. if containerLen != 0 {
  6915. fastpathTV.DecMapUint8StringL(*vp, containerLen, d)
  6916. }
  6917. } else if containerLen != 0 {
  6918. fastpathTV.DecMapUint8StringL(rv2i(rv).(map[uint8]string), containerLen, d)
  6919. }
  6920. d.mapEnd()
  6921. }
  6922. }
  6923. func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) {
  6924. containerLen := d.mapStart()
  6925. if containerLen == decContainerLenNil {
  6926. *vp = nil
  6927. } else {
  6928. if *vp == nil {
  6929. *vp = make(map[uint8]string, decInferLen(containerLen, d.h.MaxInitLen, 17))
  6930. }
  6931. if containerLen != 0 {
  6932. f.DecMapUint8StringL(*vp, containerLen, d)
  6933. }
  6934. d.mapEnd()
  6935. }
  6936. }
  6937. func (fastpathT) DecMapUint8StringL(v map[uint8]string, containerLen int, d *Decoder) {
  6938. var mk uint8
  6939. var mv string
  6940. hasLen := containerLen > 0
  6941. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6942. d.mapElemKey()
  6943. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6944. d.mapElemValue()
  6945. mv = string(d.d.DecodeStringAsBytes())
  6946. if v != nil {
  6947. v[mk] = mv
  6948. }
  6949. }
  6950. }
  6951. func (d *Decoder) fastpathDecMapUint8BytesR(f *codecFnInfo, rv reflect.Value) {
  6952. containerLen := d.mapStart()
  6953. if containerLen == decContainerLenNil {
  6954. if rv.Kind() == reflect.Ptr {
  6955. *(rv2i(rv).(*map[uint8][]byte)) = nil
  6956. }
  6957. } else {
  6958. if rv.Kind() == reflect.Ptr {
  6959. vp, _ := rv2i(rv).(*map[uint8][]byte)
  6960. if *vp == nil {
  6961. *vp = make(map[uint8][]byte, decInferLen(containerLen, d.h.MaxInitLen, 25))
  6962. }
  6963. if containerLen != 0 {
  6964. fastpathTV.DecMapUint8BytesL(*vp, containerLen, d)
  6965. }
  6966. } else if containerLen != 0 {
  6967. fastpathTV.DecMapUint8BytesL(rv2i(rv).(map[uint8][]byte), containerLen, d)
  6968. }
  6969. d.mapEnd()
  6970. }
  6971. }
  6972. func (f fastpathT) DecMapUint8BytesX(vp *map[uint8][]byte, d *Decoder) {
  6973. containerLen := d.mapStart()
  6974. if containerLen == decContainerLenNil {
  6975. *vp = nil
  6976. } else {
  6977. if *vp == nil {
  6978. *vp = make(map[uint8][]byte, decInferLen(containerLen, d.h.MaxInitLen, 25))
  6979. }
  6980. if containerLen != 0 {
  6981. f.DecMapUint8BytesL(*vp, containerLen, d)
  6982. }
  6983. d.mapEnd()
  6984. }
  6985. }
  6986. func (fastpathT) DecMapUint8BytesL(v map[uint8][]byte, containerLen int, d *Decoder) {
  6987. mapGet := v != nil && !d.h.MapValueReset
  6988. var mk uint8
  6989. var mv []byte
  6990. hasLen := containerLen > 0
  6991. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  6992. d.mapElemKey()
  6993. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  6994. d.mapElemValue()
  6995. if mapGet {
  6996. mv = v[mk]
  6997. } else {
  6998. mv = nil
  6999. }
  7000. mv = d.d.DecodeBytes(mv, false)
  7001. if v != nil {
  7002. v[mk] = mv
  7003. }
  7004. }
  7005. }
  7006. func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) {
  7007. containerLen := d.mapStart()
  7008. if containerLen == decContainerLenNil {
  7009. if rv.Kind() == reflect.Ptr {
  7010. *(rv2i(rv).(*map[uint8]uint)) = nil
  7011. }
  7012. } else {
  7013. if rv.Kind() == reflect.Ptr {
  7014. vp, _ := rv2i(rv).(*map[uint8]uint)
  7015. if *vp == nil {
  7016. *vp = make(map[uint8]uint, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7017. }
  7018. if containerLen != 0 {
  7019. fastpathTV.DecMapUint8UintL(*vp, containerLen, d)
  7020. }
  7021. } else if containerLen != 0 {
  7022. fastpathTV.DecMapUint8UintL(rv2i(rv).(map[uint8]uint), containerLen, d)
  7023. }
  7024. d.mapEnd()
  7025. }
  7026. }
  7027. func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) {
  7028. containerLen := d.mapStart()
  7029. if containerLen == decContainerLenNil {
  7030. *vp = nil
  7031. } else {
  7032. if *vp == nil {
  7033. *vp = make(map[uint8]uint, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7034. }
  7035. if containerLen != 0 {
  7036. f.DecMapUint8UintL(*vp, containerLen, d)
  7037. }
  7038. d.mapEnd()
  7039. }
  7040. }
  7041. func (fastpathT) DecMapUint8UintL(v map[uint8]uint, containerLen int, d *Decoder) {
  7042. var mk uint8
  7043. var mv uint
  7044. hasLen := containerLen > 0
  7045. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7046. d.mapElemKey()
  7047. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7048. d.mapElemValue()
  7049. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7050. if v != nil {
  7051. v[mk] = mv
  7052. }
  7053. }
  7054. }
  7055. func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) {
  7056. containerLen := d.mapStart()
  7057. if containerLen == decContainerLenNil {
  7058. if rv.Kind() == reflect.Ptr {
  7059. *(rv2i(rv).(*map[uint8]uint8)) = nil
  7060. }
  7061. } else {
  7062. if rv.Kind() == reflect.Ptr {
  7063. vp, _ := rv2i(rv).(*map[uint8]uint8)
  7064. if *vp == nil {
  7065. *vp = make(map[uint8]uint8, decInferLen(containerLen, d.h.MaxInitLen, 2))
  7066. }
  7067. if containerLen != 0 {
  7068. fastpathTV.DecMapUint8Uint8L(*vp, containerLen, d)
  7069. }
  7070. } else if containerLen != 0 {
  7071. fastpathTV.DecMapUint8Uint8L(rv2i(rv).(map[uint8]uint8), containerLen, d)
  7072. }
  7073. d.mapEnd()
  7074. }
  7075. }
  7076. func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) {
  7077. containerLen := d.mapStart()
  7078. if containerLen == decContainerLenNil {
  7079. *vp = nil
  7080. } else {
  7081. if *vp == nil {
  7082. *vp = make(map[uint8]uint8, decInferLen(containerLen, d.h.MaxInitLen, 2))
  7083. }
  7084. if containerLen != 0 {
  7085. f.DecMapUint8Uint8L(*vp, containerLen, d)
  7086. }
  7087. d.mapEnd()
  7088. }
  7089. }
  7090. func (fastpathT) DecMapUint8Uint8L(v map[uint8]uint8, containerLen int, d *Decoder) {
  7091. var mk uint8
  7092. var mv uint8
  7093. hasLen := containerLen > 0
  7094. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7095. d.mapElemKey()
  7096. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7097. d.mapElemValue()
  7098. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7099. if v != nil {
  7100. v[mk] = mv
  7101. }
  7102. }
  7103. }
  7104. func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) {
  7105. containerLen := d.mapStart()
  7106. if containerLen == decContainerLenNil {
  7107. if rv.Kind() == reflect.Ptr {
  7108. *(rv2i(rv).(*map[uint8]uint64)) = nil
  7109. }
  7110. } else {
  7111. if rv.Kind() == reflect.Ptr {
  7112. vp, _ := rv2i(rv).(*map[uint8]uint64)
  7113. if *vp == nil {
  7114. *vp = make(map[uint8]uint64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7115. }
  7116. if containerLen != 0 {
  7117. fastpathTV.DecMapUint8Uint64L(*vp, containerLen, d)
  7118. }
  7119. } else if containerLen != 0 {
  7120. fastpathTV.DecMapUint8Uint64L(rv2i(rv).(map[uint8]uint64), containerLen, d)
  7121. }
  7122. d.mapEnd()
  7123. }
  7124. }
  7125. func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) {
  7126. containerLen := d.mapStart()
  7127. if containerLen == decContainerLenNil {
  7128. *vp = nil
  7129. } else {
  7130. if *vp == nil {
  7131. *vp = make(map[uint8]uint64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7132. }
  7133. if containerLen != 0 {
  7134. f.DecMapUint8Uint64L(*vp, containerLen, d)
  7135. }
  7136. d.mapEnd()
  7137. }
  7138. }
  7139. func (fastpathT) DecMapUint8Uint64L(v map[uint8]uint64, containerLen int, d *Decoder) {
  7140. var mk uint8
  7141. var mv uint64
  7142. hasLen := containerLen > 0
  7143. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7144. d.mapElemKey()
  7145. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7146. d.mapElemValue()
  7147. mv = d.d.DecodeUint64()
  7148. if v != nil {
  7149. v[mk] = mv
  7150. }
  7151. }
  7152. }
  7153. func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) {
  7154. containerLen := d.mapStart()
  7155. if containerLen == decContainerLenNil {
  7156. if rv.Kind() == reflect.Ptr {
  7157. *(rv2i(rv).(*map[uint8]int)) = nil
  7158. }
  7159. } else {
  7160. if rv.Kind() == reflect.Ptr {
  7161. vp, _ := rv2i(rv).(*map[uint8]int)
  7162. if *vp == nil {
  7163. *vp = make(map[uint8]int, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7164. }
  7165. if containerLen != 0 {
  7166. fastpathTV.DecMapUint8IntL(*vp, containerLen, d)
  7167. }
  7168. } else if containerLen != 0 {
  7169. fastpathTV.DecMapUint8IntL(rv2i(rv).(map[uint8]int), containerLen, d)
  7170. }
  7171. d.mapEnd()
  7172. }
  7173. }
  7174. func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) {
  7175. containerLen := d.mapStart()
  7176. if containerLen == decContainerLenNil {
  7177. *vp = nil
  7178. } else {
  7179. if *vp == nil {
  7180. *vp = make(map[uint8]int, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7181. }
  7182. if containerLen != 0 {
  7183. f.DecMapUint8IntL(*vp, containerLen, d)
  7184. }
  7185. d.mapEnd()
  7186. }
  7187. }
  7188. func (fastpathT) DecMapUint8IntL(v map[uint8]int, containerLen int, d *Decoder) {
  7189. var mk uint8
  7190. var mv int
  7191. hasLen := containerLen > 0
  7192. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7193. d.mapElemKey()
  7194. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7195. d.mapElemValue()
  7196. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7197. if v != nil {
  7198. v[mk] = mv
  7199. }
  7200. }
  7201. }
  7202. func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) {
  7203. containerLen := d.mapStart()
  7204. if containerLen == decContainerLenNil {
  7205. if rv.Kind() == reflect.Ptr {
  7206. *(rv2i(rv).(*map[uint8]int64)) = nil
  7207. }
  7208. } else {
  7209. if rv.Kind() == reflect.Ptr {
  7210. vp, _ := rv2i(rv).(*map[uint8]int64)
  7211. if *vp == nil {
  7212. *vp = make(map[uint8]int64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7213. }
  7214. if containerLen != 0 {
  7215. fastpathTV.DecMapUint8Int64L(*vp, containerLen, d)
  7216. }
  7217. } else if containerLen != 0 {
  7218. fastpathTV.DecMapUint8Int64L(rv2i(rv).(map[uint8]int64), containerLen, d)
  7219. }
  7220. d.mapEnd()
  7221. }
  7222. }
  7223. func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) {
  7224. containerLen := d.mapStart()
  7225. if containerLen == decContainerLenNil {
  7226. *vp = nil
  7227. } else {
  7228. if *vp == nil {
  7229. *vp = make(map[uint8]int64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7230. }
  7231. if containerLen != 0 {
  7232. f.DecMapUint8Int64L(*vp, containerLen, d)
  7233. }
  7234. d.mapEnd()
  7235. }
  7236. }
  7237. func (fastpathT) DecMapUint8Int64L(v map[uint8]int64, containerLen int, d *Decoder) {
  7238. var mk uint8
  7239. var mv int64
  7240. hasLen := containerLen > 0
  7241. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7242. d.mapElemKey()
  7243. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7244. d.mapElemValue()
  7245. mv = d.d.DecodeInt64()
  7246. if v != nil {
  7247. v[mk] = mv
  7248. }
  7249. }
  7250. }
  7251. func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) {
  7252. containerLen := d.mapStart()
  7253. if containerLen == decContainerLenNil {
  7254. if rv.Kind() == reflect.Ptr {
  7255. *(rv2i(rv).(*map[uint8]float32)) = nil
  7256. }
  7257. } else {
  7258. if rv.Kind() == reflect.Ptr {
  7259. vp, _ := rv2i(rv).(*map[uint8]float32)
  7260. if *vp == nil {
  7261. *vp = make(map[uint8]float32, decInferLen(containerLen, d.h.MaxInitLen, 5))
  7262. }
  7263. if containerLen != 0 {
  7264. fastpathTV.DecMapUint8Float32L(*vp, containerLen, d)
  7265. }
  7266. } else if containerLen != 0 {
  7267. fastpathTV.DecMapUint8Float32L(rv2i(rv).(map[uint8]float32), containerLen, d)
  7268. }
  7269. d.mapEnd()
  7270. }
  7271. }
  7272. func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) {
  7273. containerLen := d.mapStart()
  7274. if containerLen == decContainerLenNil {
  7275. *vp = nil
  7276. } else {
  7277. if *vp == nil {
  7278. *vp = make(map[uint8]float32, decInferLen(containerLen, d.h.MaxInitLen, 5))
  7279. }
  7280. if containerLen != 0 {
  7281. f.DecMapUint8Float32L(*vp, containerLen, d)
  7282. }
  7283. d.mapEnd()
  7284. }
  7285. }
  7286. func (fastpathT) DecMapUint8Float32L(v map[uint8]float32, containerLen int, d *Decoder) {
  7287. var mk uint8
  7288. var mv float32
  7289. hasLen := containerLen > 0
  7290. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7291. d.mapElemKey()
  7292. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7293. d.mapElemValue()
  7294. mv = float32(d.decodeFloat32())
  7295. if v != nil {
  7296. v[mk] = mv
  7297. }
  7298. }
  7299. }
  7300. func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) {
  7301. containerLen := d.mapStart()
  7302. if containerLen == decContainerLenNil {
  7303. if rv.Kind() == reflect.Ptr {
  7304. *(rv2i(rv).(*map[uint8]float64)) = nil
  7305. }
  7306. } else {
  7307. if rv.Kind() == reflect.Ptr {
  7308. vp, _ := rv2i(rv).(*map[uint8]float64)
  7309. if *vp == nil {
  7310. *vp = make(map[uint8]float64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7311. }
  7312. if containerLen != 0 {
  7313. fastpathTV.DecMapUint8Float64L(*vp, containerLen, d)
  7314. }
  7315. } else if containerLen != 0 {
  7316. fastpathTV.DecMapUint8Float64L(rv2i(rv).(map[uint8]float64), containerLen, d)
  7317. }
  7318. d.mapEnd()
  7319. }
  7320. }
  7321. func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) {
  7322. containerLen := d.mapStart()
  7323. if containerLen == decContainerLenNil {
  7324. *vp = nil
  7325. } else {
  7326. if *vp == nil {
  7327. *vp = make(map[uint8]float64, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7328. }
  7329. if containerLen != 0 {
  7330. f.DecMapUint8Float64L(*vp, containerLen, d)
  7331. }
  7332. d.mapEnd()
  7333. }
  7334. }
  7335. func (fastpathT) DecMapUint8Float64L(v map[uint8]float64, containerLen int, d *Decoder) {
  7336. var mk uint8
  7337. var mv float64
  7338. hasLen := containerLen > 0
  7339. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7340. d.mapElemKey()
  7341. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7342. d.mapElemValue()
  7343. mv = d.d.DecodeFloat64()
  7344. if v != nil {
  7345. v[mk] = mv
  7346. }
  7347. }
  7348. }
  7349. func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) {
  7350. containerLen := d.mapStart()
  7351. if containerLen == decContainerLenNil {
  7352. if rv.Kind() == reflect.Ptr {
  7353. *(rv2i(rv).(*map[uint8]bool)) = nil
  7354. }
  7355. } else {
  7356. if rv.Kind() == reflect.Ptr {
  7357. vp, _ := rv2i(rv).(*map[uint8]bool)
  7358. if *vp == nil {
  7359. *vp = make(map[uint8]bool, decInferLen(containerLen, d.h.MaxInitLen, 2))
  7360. }
  7361. if containerLen != 0 {
  7362. fastpathTV.DecMapUint8BoolL(*vp, containerLen, d)
  7363. }
  7364. } else if containerLen != 0 {
  7365. fastpathTV.DecMapUint8BoolL(rv2i(rv).(map[uint8]bool), containerLen, d)
  7366. }
  7367. d.mapEnd()
  7368. }
  7369. }
  7370. func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) {
  7371. containerLen := d.mapStart()
  7372. if containerLen == decContainerLenNil {
  7373. *vp = nil
  7374. } else {
  7375. if *vp == nil {
  7376. *vp = make(map[uint8]bool, decInferLen(containerLen, d.h.MaxInitLen, 2))
  7377. }
  7378. if containerLen != 0 {
  7379. f.DecMapUint8BoolL(*vp, containerLen, d)
  7380. }
  7381. d.mapEnd()
  7382. }
  7383. }
  7384. func (fastpathT) DecMapUint8BoolL(v map[uint8]bool, containerLen int, d *Decoder) {
  7385. var mk uint8
  7386. var mv bool
  7387. hasLen := containerLen > 0
  7388. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7389. d.mapElemKey()
  7390. mk = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7391. d.mapElemValue()
  7392. mv = d.d.DecodeBool()
  7393. if v != nil {
  7394. v[mk] = mv
  7395. }
  7396. }
  7397. }
  7398. func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) {
  7399. containerLen := d.mapStart()
  7400. if containerLen == decContainerLenNil {
  7401. if rv.Kind() == reflect.Ptr {
  7402. *(rv2i(rv).(*map[uint64]interface{})) = nil
  7403. }
  7404. } else {
  7405. if rv.Kind() == reflect.Ptr {
  7406. vp, _ := rv2i(rv).(*map[uint64]interface{})
  7407. if *vp == nil {
  7408. *vp = make(map[uint64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7409. }
  7410. if containerLen != 0 {
  7411. fastpathTV.DecMapUint64IntfL(*vp, containerLen, d)
  7412. }
  7413. } else if containerLen != 0 {
  7414. fastpathTV.DecMapUint64IntfL(rv2i(rv).(map[uint64]interface{}), containerLen, d)
  7415. }
  7416. d.mapEnd()
  7417. }
  7418. }
  7419. func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) {
  7420. containerLen := d.mapStart()
  7421. if containerLen == decContainerLenNil {
  7422. *vp = nil
  7423. } else {
  7424. if *vp == nil {
  7425. *vp = make(map[uint64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7426. }
  7427. if containerLen != 0 {
  7428. f.DecMapUint64IntfL(*vp, containerLen, d)
  7429. }
  7430. d.mapEnd()
  7431. }
  7432. }
  7433. func (fastpathT) DecMapUint64IntfL(v map[uint64]interface{}, containerLen int, d *Decoder) {
  7434. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7435. var mk uint64
  7436. var mv interface{}
  7437. hasLen := containerLen > 0
  7438. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7439. d.mapElemKey()
  7440. mk = d.d.DecodeUint64()
  7441. d.mapElemValue()
  7442. if mapGet {
  7443. mv = v[mk]
  7444. } else {
  7445. mv = nil
  7446. }
  7447. d.decode(&mv)
  7448. if v != nil {
  7449. v[mk] = mv
  7450. }
  7451. }
  7452. }
  7453. func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) {
  7454. containerLen := d.mapStart()
  7455. if containerLen == decContainerLenNil {
  7456. if rv.Kind() == reflect.Ptr {
  7457. *(rv2i(rv).(*map[uint64]string)) = nil
  7458. }
  7459. } else {
  7460. if rv.Kind() == reflect.Ptr {
  7461. vp, _ := rv2i(rv).(*map[uint64]string)
  7462. if *vp == nil {
  7463. *vp = make(map[uint64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7464. }
  7465. if containerLen != 0 {
  7466. fastpathTV.DecMapUint64StringL(*vp, containerLen, d)
  7467. }
  7468. } else if containerLen != 0 {
  7469. fastpathTV.DecMapUint64StringL(rv2i(rv).(map[uint64]string), containerLen, d)
  7470. }
  7471. d.mapEnd()
  7472. }
  7473. }
  7474. func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) {
  7475. containerLen := d.mapStart()
  7476. if containerLen == decContainerLenNil {
  7477. *vp = nil
  7478. } else {
  7479. if *vp == nil {
  7480. *vp = make(map[uint64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7481. }
  7482. if containerLen != 0 {
  7483. f.DecMapUint64StringL(*vp, containerLen, d)
  7484. }
  7485. d.mapEnd()
  7486. }
  7487. }
  7488. func (fastpathT) DecMapUint64StringL(v map[uint64]string, containerLen int, d *Decoder) {
  7489. var mk uint64
  7490. var mv string
  7491. hasLen := containerLen > 0
  7492. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7493. d.mapElemKey()
  7494. mk = d.d.DecodeUint64()
  7495. d.mapElemValue()
  7496. mv = string(d.d.DecodeStringAsBytes())
  7497. if v != nil {
  7498. v[mk] = mv
  7499. }
  7500. }
  7501. }
  7502. func (d *Decoder) fastpathDecMapUint64BytesR(f *codecFnInfo, rv reflect.Value) {
  7503. containerLen := d.mapStart()
  7504. if containerLen == decContainerLenNil {
  7505. if rv.Kind() == reflect.Ptr {
  7506. *(rv2i(rv).(*map[uint64][]byte)) = nil
  7507. }
  7508. } else {
  7509. if rv.Kind() == reflect.Ptr {
  7510. vp, _ := rv2i(rv).(*map[uint64][]byte)
  7511. if *vp == nil {
  7512. *vp = make(map[uint64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  7513. }
  7514. if containerLen != 0 {
  7515. fastpathTV.DecMapUint64BytesL(*vp, containerLen, d)
  7516. }
  7517. } else if containerLen != 0 {
  7518. fastpathTV.DecMapUint64BytesL(rv2i(rv).(map[uint64][]byte), containerLen, d)
  7519. }
  7520. d.mapEnd()
  7521. }
  7522. }
  7523. func (f fastpathT) DecMapUint64BytesX(vp *map[uint64][]byte, d *Decoder) {
  7524. containerLen := d.mapStart()
  7525. if containerLen == decContainerLenNil {
  7526. *vp = nil
  7527. } else {
  7528. if *vp == nil {
  7529. *vp = make(map[uint64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  7530. }
  7531. if containerLen != 0 {
  7532. f.DecMapUint64BytesL(*vp, containerLen, d)
  7533. }
  7534. d.mapEnd()
  7535. }
  7536. }
  7537. func (fastpathT) DecMapUint64BytesL(v map[uint64][]byte, containerLen int, d *Decoder) {
  7538. mapGet := v != nil && !d.h.MapValueReset
  7539. var mk uint64
  7540. var mv []byte
  7541. hasLen := containerLen > 0
  7542. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7543. d.mapElemKey()
  7544. mk = d.d.DecodeUint64()
  7545. d.mapElemValue()
  7546. if mapGet {
  7547. mv = v[mk]
  7548. } else {
  7549. mv = nil
  7550. }
  7551. mv = d.d.DecodeBytes(mv, false)
  7552. if v != nil {
  7553. v[mk] = mv
  7554. }
  7555. }
  7556. }
  7557. func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) {
  7558. containerLen := d.mapStart()
  7559. if containerLen == decContainerLenNil {
  7560. if rv.Kind() == reflect.Ptr {
  7561. *(rv2i(rv).(*map[uint64]uint)) = nil
  7562. }
  7563. } else {
  7564. if rv.Kind() == reflect.Ptr {
  7565. vp, _ := rv2i(rv).(*map[uint64]uint)
  7566. if *vp == nil {
  7567. *vp = make(map[uint64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7568. }
  7569. if containerLen != 0 {
  7570. fastpathTV.DecMapUint64UintL(*vp, containerLen, d)
  7571. }
  7572. } else if containerLen != 0 {
  7573. fastpathTV.DecMapUint64UintL(rv2i(rv).(map[uint64]uint), containerLen, d)
  7574. }
  7575. d.mapEnd()
  7576. }
  7577. }
  7578. func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) {
  7579. containerLen := d.mapStart()
  7580. if containerLen == decContainerLenNil {
  7581. *vp = nil
  7582. } else {
  7583. if *vp == nil {
  7584. *vp = make(map[uint64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7585. }
  7586. if containerLen != 0 {
  7587. f.DecMapUint64UintL(*vp, containerLen, d)
  7588. }
  7589. d.mapEnd()
  7590. }
  7591. }
  7592. func (fastpathT) DecMapUint64UintL(v map[uint64]uint, containerLen int, d *Decoder) {
  7593. var mk uint64
  7594. var mv uint
  7595. hasLen := containerLen > 0
  7596. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7597. d.mapElemKey()
  7598. mk = d.d.DecodeUint64()
  7599. d.mapElemValue()
  7600. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  7601. if v != nil {
  7602. v[mk] = mv
  7603. }
  7604. }
  7605. }
  7606. func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) {
  7607. containerLen := d.mapStart()
  7608. if containerLen == decContainerLenNil {
  7609. if rv.Kind() == reflect.Ptr {
  7610. *(rv2i(rv).(*map[uint64]uint8)) = nil
  7611. }
  7612. } else {
  7613. if rv.Kind() == reflect.Ptr {
  7614. vp, _ := rv2i(rv).(*map[uint64]uint8)
  7615. if *vp == nil {
  7616. *vp = make(map[uint64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7617. }
  7618. if containerLen != 0 {
  7619. fastpathTV.DecMapUint64Uint8L(*vp, containerLen, d)
  7620. }
  7621. } else if containerLen != 0 {
  7622. fastpathTV.DecMapUint64Uint8L(rv2i(rv).(map[uint64]uint8), containerLen, d)
  7623. }
  7624. d.mapEnd()
  7625. }
  7626. }
  7627. func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) {
  7628. containerLen := d.mapStart()
  7629. if containerLen == decContainerLenNil {
  7630. *vp = nil
  7631. } else {
  7632. if *vp == nil {
  7633. *vp = make(map[uint64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7634. }
  7635. if containerLen != 0 {
  7636. f.DecMapUint64Uint8L(*vp, containerLen, d)
  7637. }
  7638. d.mapEnd()
  7639. }
  7640. }
  7641. func (fastpathT) DecMapUint64Uint8L(v map[uint64]uint8, containerLen int, d *Decoder) {
  7642. var mk uint64
  7643. var mv uint8
  7644. hasLen := containerLen > 0
  7645. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7646. d.mapElemKey()
  7647. mk = d.d.DecodeUint64()
  7648. d.mapElemValue()
  7649. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  7650. if v != nil {
  7651. v[mk] = mv
  7652. }
  7653. }
  7654. }
  7655. func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) {
  7656. containerLen := d.mapStart()
  7657. if containerLen == decContainerLenNil {
  7658. if rv.Kind() == reflect.Ptr {
  7659. *(rv2i(rv).(*map[uint64]uint64)) = nil
  7660. }
  7661. } else {
  7662. if rv.Kind() == reflect.Ptr {
  7663. vp, _ := rv2i(rv).(*map[uint64]uint64)
  7664. if *vp == nil {
  7665. *vp = make(map[uint64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7666. }
  7667. if containerLen != 0 {
  7668. fastpathTV.DecMapUint64Uint64L(*vp, containerLen, d)
  7669. }
  7670. } else if containerLen != 0 {
  7671. fastpathTV.DecMapUint64Uint64L(rv2i(rv).(map[uint64]uint64), containerLen, d)
  7672. }
  7673. d.mapEnd()
  7674. }
  7675. }
  7676. func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) {
  7677. containerLen := d.mapStart()
  7678. if containerLen == decContainerLenNil {
  7679. *vp = nil
  7680. } else {
  7681. if *vp == nil {
  7682. *vp = make(map[uint64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7683. }
  7684. if containerLen != 0 {
  7685. f.DecMapUint64Uint64L(*vp, containerLen, d)
  7686. }
  7687. d.mapEnd()
  7688. }
  7689. }
  7690. func (fastpathT) DecMapUint64Uint64L(v map[uint64]uint64, containerLen int, d *Decoder) {
  7691. var mk uint64
  7692. var mv uint64
  7693. hasLen := containerLen > 0
  7694. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7695. d.mapElemKey()
  7696. mk = d.d.DecodeUint64()
  7697. d.mapElemValue()
  7698. mv = d.d.DecodeUint64()
  7699. if v != nil {
  7700. v[mk] = mv
  7701. }
  7702. }
  7703. }
  7704. func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) {
  7705. containerLen := d.mapStart()
  7706. if containerLen == decContainerLenNil {
  7707. if rv.Kind() == reflect.Ptr {
  7708. *(rv2i(rv).(*map[uint64]int)) = nil
  7709. }
  7710. } else {
  7711. if rv.Kind() == reflect.Ptr {
  7712. vp, _ := rv2i(rv).(*map[uint64]int)
  7713. if *vp == nil {
  7714. *vp = make(map[uint64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7715. }
  7716. if containerLen != 0 {
  7717. fastpathTV.DecMapUint64IntL(*vp, containerLen, d)
  7718. }
  7719. } else if containerLen != 0 {
  7720. fastpathTV.DecMapUint64IntL(rv2i(rv).(map[uint64]int), containerLen, d)
  7721. }
  7722. d.mapEnd()
  7723. }
  7724. }
  7725. func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) {
  7726. containerLen := d.mapStart()
  7727. if containerLen == decContainerLenNil {
  7728. *vp = nil
  7729. } else {
  7730. if *vp == nil {
  7731. *vp = make(map[uint64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7732. }
  7733. if containerLen != 0 {
  7734. f.DecMapUint64IntL(*vp, containerLen, d)
  7735. }
  7736. d.mapEnd()
  7737. }
  7738. }
  7739. func (fastpathT) DecMapUint64IntL(v map[uint64]int, containerLen int, d *Decoder) {
  7740. var mk uint64
  7741. var mv int
  7742. hasLen := containerLen > 0
  7743. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7744. d.mapElemKey()
  7745. mk = d.d.DecodeUint64()
  7746. d.mapElemValue()
  7747. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7748. if v != nil {
  7749. v[mk] = mv
  7750. }
  7751. }
  7752. }
  7753. func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) {
  7754. containerLen := d.mapStart()
  7755. if containerLen == decContainerLenNil {
  7756. if rv.Kind() == reflect.Ptr {
  7757. *(rv2i(rv).(*map[uint64]int64)) = nil
  7758. }
  7759. } else {
  7760. if rv.Kind() == reflect.Ptr {
  7761. vp, _ := rv2i(rv).(*map[uint64]int64)
  7762. if *vp == nil {
  7763. *vp = make(map[uint64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7764. }
  7765. if containerLen != 0 {
  7766. fastpathTV.DecMapUint64Int64L(*vp, containerLen, d)
  7767. }
  7768. } else if containerLen != 0 {
  7769. fastpathTV.DecMapUint64Int64L(rv2i(rv).(map[uint64]int64), containerLen, d)
  7770. }
  7771. d.mapEnd()
  7772. }
  7773. }
  7774. func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) {
  7775. containerLen := d.mapStart()
  7776. if containerLen == decContainerLenNil {
  7777. *vp = nil
  7778. } else {
  7779. if *vp == nil {
  7780. *vp = make(map[uint64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7781. }
  7782. if containerLen != 0 {
  7783. f.DecMapUint64Int64L(*vp, containerLen, d)
  7784. }
  7785. d.mapEnd()
  7786. }
  7787. }
  7788. func (fastpathT) DecMapUint64Int64L(v map[uint64]int64, containerLen int, d *Decoder) {
  7789. var mk uint64
  7790. var mv int64
  7791. hasLen := containerLen > 0
  7792. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7793. d.mapElemKey()
  7794. mk = d.d.DecodeUint64()
  7795. d.mapElemValue()
  7796. mv = d.d.DecodeInt64()
  7797. if v != nil {
  7798. v[mk] = mv
  7799. }
  7800. }
  7801. }
  7802. func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) {
  7803. containerLen := d.mapStart()
  7804. if containerLen == decContainerLenNil {
  7805. if rv.Kind() == reflect.Ptr {
  7806. *(rv2i(rv).(*map[uint64]float32)) = nil
  7807. }
  7808. } else {
  7809. if rv.Kind() == reflect.Ptr {
  7810. vp, _ := rv2i(rv).(*map[uint64]float32)
  7811. if *vp == nil {
  7812. *vp = make(map[uint64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  7813. }
  7814. if containerLen != 0 {
  7815. fastpathTV.DecMapUint64Float32L(*vp, containerLen, d)
  7816. }
  7817. } else if containerLen != 0 {
  7818. fastpathTV.DecMapUint64Float32L(rv2i(rv).(map[uint64]float32), containerLen, d)
  7819. }
  7820. d.mapEnd()
  7821. }
  7822. }
  7823. func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) {
  7824. containerLen := d.mapStart()
  7825. if containerLen == decContainerLenNil {
  7826. *vp = nil
  7827. } else {
  7828. if *vp == nil {
  7829. *vp = make(map[uint64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  7830. }
  7831. if containerLen != 0 {
  7832. f.DecMapUint64Float32L(*vp, containerLen, d)
  7833. }
  7834. d.mapEnd()
  7835. }
  7836. }
  7837. func (fastpathT) DecMapUint64Float32L(v map[uint64]float32, containerLen int, d *Decoder) {
  7838. var mk uint64
  7839. var mv float32
  7840. hasLen := containerLen > 0
  7841. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7842. d.mapElemKey()
  7843. mk = d.d.DecodeUint64()
  7844. d.mapElemValue()
  7845. mv = float32(d.decodeFloat32())
  7846. if v != nil {
  7847. v[mk] = mv
  7848. }
  7849. }
  7850. }
  7851. func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) {
  7852. containerLen := d.mapStart()
  7853. if containerLen == decContainerLenNil {
  7854. if rv.Kind() == reflect.Ptr {
  7855. *(rv2i(rv).(*map[uint64]float64)) = nil
  7856. }
  7857. } else {
  7858. if rv.Kind() == reflect.Ptr {
  7859. vp, _ := rv2i(rv).(*map[uint64]float64)
  7860. if *vp == nil {
  7861. *vp = make(map[uint64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7862. }
  7863. if containerLen != 0 {
  7864. fastpathTV.DecMapUint64Float64L(*vp, containerLen, d)
  7865. }
  7866. } else if containerLen != 0 {
  7867. fastpathTV.DecMapUint64Float64L(rv2i(rv).(map[uint64]float64), containerLen, d)
  7868. }
  7869. d.mapEnd()
  7870. }
  7871. }
  7872. func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) {
  7873. containerLen := d.mapStart()
  7874. if containerLen == decContainerLenNil {
  7875. *vp = nil
  7876. } else {
  7877. if *vp == nil {
  7878. *vp = make(map[uint64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  7879. }
  7880. if containerLen != 0 {
  7881. f.DecMapUint64Float64L(*vp, containerLen, d)
  7882. }
  7883. d.mapEnd()
  7884. }
  7885. }
  7886. func (fastpathT) DecMapUint64Float64L(v map[uint64]float64, containerLen int, d *Decoder) {
  7887. var mk uint64
  7888. var mv float64
  7889. hasLen := containerLen > 0
  7890. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7891. d.mapElemKey()
  7892. mk = d.d.DecodeUint64()
  7893. d.mapElemValue()
  7894. mv = d.d.DecodeFloat64()
  7895. if v != nil {
  7896. v[mk] = mv
  7897. }
  7898. }
  7899. }
  7900. func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) {
  7901. containerLen := d.mapStart()
  7902. if containerLen == decContainerLenNil {
  7903. if rv.Kind() == reflect.Ptr {
  7904. *(rv2i(rv).(*map[uint64]bool)) = nil
  7905. }
  7906. } else {
  7907. if rv.Kind() == reflect.Ptr {
  7908. vp, _ := rv2i(rv).(*map[uint64]bool)
  7909. if *vp == nil {
  7910. *vp = make(map[uint64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7911. }
  7912. if containerLen != 0 {
  7913. fastpathTV.DecMapUint64BoolL(*vp, containerLen, d)
  7914. }
  7915. } else if containerLen != 0 {
  7916. fastpathTV.DecMapUint64BoolL(rv2i(rv).(map[uint64]bool), containerLen, d)
  7917. }
  7918. d.mapEnd()
  7919. }
  7920. }
  7921. func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) {
  7922. containerLen := d.mapStart()
  7923. if containerLen == decContainerLenNil {
  7924. *vp = nil
  7925. } else {
  7926. if *vp == nil {
  7927. *vp = make(map[uint64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  7928. }
  7929. if containerLen != 0 {
  7930. f.DecMapUint64BoolL(*vp, containerLen, d)
  7931. }
  7932. d.mapEnd()
  7933. }
  7934. }
  7935. func (fastpathT) DecMapUint64BoolL(v map[uint64]bool, containerLen int, d *Decoder) {
  7936. var mk uint64
  7937. var mv bool
  7938. hasLen := containerLen > 0
  7939. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7940. d.mapElemKey()
  7941. mk = d.d.DecodeUint64()
  7942. d.mapElemValue()
  7943. mv = d.d.DecodeBool()
  7944. if v != nil {
  7945. v[mk] = mv
  7946. }
  7947. }
  7948. }
  7949. func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) {
  7950. containerLen := d.mapStart()
  7951. if containerLen == decContainerLenNil {
  7952. if rv.Kind() == reflect.Ptr {
  7953. *(rv2i(rv).(*map[int]interface{})) = nil
  7954. }
  7955. } else {
  7956. if rv.Kind() == reflect.Ptr {
  7957. vp, _ := rv2i(rv).(*map[int]interface{})
  7958. if *vp == nil {
  7959. *vp = make(map[int]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7960. }
  7961. if containerLen != 0 {
  7962. fastpathTV.DecMapIntIntfL(*vp, containerLen, d)
  7963. }
  7964. } else if containerLen != 0 {
  7965. fastpathTV.DecMapIntIntfL(rv2i(rv).(map[int]interface{}), containerLen, d)
  7966. }
  7967. d.mapEnd()
  7968. }
  7969. }
  7970. func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) {
  7971. containerLen := d.mapStart()
  7972. if containerLen == decContainerLenNil {
  7973. *vp = nil
  7974. } else {
  7975. if *vp == nil {
  7976. *vp = make(map[int]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  7977. }
  7978. if containerLen != 0 {
  7979. f.DecMapIntIntfL(*vp, containerLen, d)
  7980. }
  7981. d.mapEnd()
  7982. }
  7983. }
  7984. func (fastpathT) DecMapIntIntfL(v map[int]interface{}, containerLen int, d *Decoder) {
  7985. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  7986. var mk int
  7987. var mv interface{}
  7988. hasLen := containerLen > 0
  7989. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  7990. d.mapElemKey()
  7991. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  7992. d.mapElemValue()
  7993. if mapGet {
  7994. mv = v[mk]
  7995. } else {
  7996. mv = nil
  7997. }
  7998. d.decode(&mv)
  7999. if v != nil {
  8000. v[mk] = mv
  8001. }
  8002. }
  8003. }
  8004. func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) {
  8005. containerLen := d.mapStart()
  8006. if containerLen == decContainerLenNil {
  8007. if rv.Kind() == reflect.Ptr {
  8008. *(rv2i(rv).(*map[int]string)) = nil
  8009. }
  8010. } else {
  8011. if rv.Kind() == reflect.Ptr {
  8012. vp, _ := rv2i(rv).(*map[int]string)
  8013. if *vp == nil {
  8014. *vp = make(map[int]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8015. }
  8016. if containerLen != 0 {
  8017. fastpathTV.DecMapIntStringL(*vp, containerLen, d)
  8018. }
  8019. } else if containerLen != 0 {
  8020. fastpathTV.DecMapIntStringL(rv2i(rv).(map[int]string), containerLen, d)
  8021. }
  8022. d.mapEnd()
  8023. }
  8024. }
  8025. func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) {
  8026. containerLen := d.mapStart()
  8027. if containerLen == decContainerLenNil {
  8028. *vp = nil
  8029. } else {
  8030. if *vp == nil {
  8031. *vp = make(map[int]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8032. }
  8033. if containerLen != 0 {
  8034. f.DecMapIntStringL(*vp, containerLen, d)
  8035. }
  8036. d.mapEnd()
  8037. }
  8038. }
  8039. func (fastpathT) DecMapIntStringL(v map[int]string, containerLen int, d *Decoder) {
  8040. var mk int
  8041. var mv string
  8042. hasLen := containerLen > 0
  8043. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8044. d.mapElemKey()
  8045. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8046. d.mapElemValue()
  8047. mv = string(d.d.DecodeStringAsBytes())
  8048. if v != nil {
  8049. v[mk] = mv
  8050. }
  8051. }
  8052. }
  8053. func (d *Decoder) fastpathDecMapIntBytesR(f *codecFnInfo, rv reflect.Value) {
  8054. containerLen := d.mapStart()
  8055. if containerLen == decContainerLenNil {
  8056. if rv.Kind() == reflect.Ptr {
  8057. *(rv2i(rv).(*map[int][]byte)) = nil
  8058. }
  8059. } else {
  8060. if rv.Kind() == reflect.Ptr {
  8061. vp, _ := rv2i(rv).(*map[int][]byte)
  8062. if *vp == nil {
  8063. *vp = make(map[int][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8064. }
  8065. if containerLen != 0 {
  8066. fastpathTV.DecMapIntBytesL(*vp, containerLen, d)
  8067. }
  8068. } else if containerLen != 0 {
  8069. fastpathTV.DecMapIntBytesL(rv2i(rv).(map[int][]byte), containerLen, d)
  8070. }
  8071. d.mapEnd()
  8072. }
  8073. }
  8074. func (f fastpathT) DecMapIntBytesX(vp *map[int][]byte, d *Decoder) {
  8075. containerLen := d.mapStart()
  8076. if containerLen == decContainerLenNil {
  8077. *vp = nil
  8078. } else {
  8079. if *vp == nil {
  8080. *vp = make(map[int][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8081. }
  8082. if containerLen != 0 {
  8083. f.DecMapIntBytesL(*vp, containerLen, d)
  8084. }
  8085. d.mapEnd()
  8086. }
  8087. }
  8088. func (fastpathT) DecMapIntBytesL(v map[int][]byte, containerLen int, d *Decoder) {
  8089. mapGet := v != nil && !d.h.MapValueReset
  8090. var mk int
  8091. var mv []byte
  8092. hasLen := containerLen > 0
  8093. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8094. d.mapElemKey()
  8095. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8096. d.mapElemValue()
  8097. if mapGet {
  8098. mv = v[mk]
  8099. } else {
  8100. mv = nil
  8101. }
  8102. mv = d.d.DecodeBytes(mv, false)
  8103. if v != nil {
  8104. v[mk] = mv
  8105. }
  8106. }
  8107. }
  8108. func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) {
  8109. containerLen := d.mapStart()
  8110. if containerLen == decContainerLenNil {
  8111. if rv.Kind() == reflect.Ptr {
  8112. *(rv2i(rv).(*map[int]uint)) = nil
  8113. }
  8114. } else {
  8115. if rv.Kind() == reflect.Ptr {
  8116. vp, _ := rv2i(rv).(*map[int]uint)
  8117. if *vp == nil {
  8118. *vp = make(map[int]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8119. }
  8120. if containerLen != 0 {
  8121. fastpathTV.DecMapIntUintL(*vp, containerLen, d)
  8122. }
  8123. } else if containerLen != 0 {
  8124. fastpathTV.DecMapIntUintL(rv2i(rv).(map[int]uint), containerLen, d)
  8125. }
  8126. d.mapEnd()
  8127. }
  8128. }
  8129. func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) {
  8130. containerLen := d.mapStart()
  8131. if containerLen == decContainerLenNil {
  8132. *vp = nil
  8133. } else {
  8134. if *vp == nil {
  8135. *vp = make(map[int]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8136. }
  8137. if containerLen != 0 {
  8138. f.DecMapIntUintL(*vp, containerLen, d)
  8139. }
  8140. d.mapEnd()
  8141. }
  8142. }
  8143. func (fastpathT) DecMapIntUintL(v map[int]uint, containerLen int, d *Decoder) {
  8144. var mk int
  8145. var mv uint
  8146. hasLen := containerLen > 0
  8147. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8148. d.mapElemKey()
  8149. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8150. d.mapElemValue()
  8151. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8152. if v != nil {
  8153. v[mk] = mv
  8154. }
  8155. }
  8156. }
  8157. func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) {
  8158. containerLen := d.mapStart()
  8159. if containerLen == decContainerLenNil {
  8160. if rv.Kind() == reflect.Ptr {
  8161. *(rv2i(rv).(*map[int]uint8)) = nil
  8162. }
  8163. } else {
  8164. if rv.Kind() == reflect.Ptr {
  8165. vp, _ := rv2i(rv).(*map[int]uint8)
  8166. if *vp == nil {
  8167. *vp = make(map[int]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8168. }
  8169. if containerLen != 0 {
  8170. fastpathTV.DecMapIntUint8L(*vp, containerLen, d)
  8171. }
  8172. } else if containerLen != 0 {
  8173. fastpathTV.DecMapIntUint8L(rv2i(rv).(map[int]uint8), containerLen, d)
  8174. }
  8175. d.mapEnd()
  8176. }
  8177. }
  8178. func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) {
  8179. containerLen := d.mapStart()
  8180. if containerLen == decContainerLenNil {
  8181. *vp = nil
  8182. } else {
  8183. if *vp == nil {
  8184. *vp = make(map[int]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8185. }
  8186. if containerLen != 0 {
  8187. f.DecMapIntUint8L(*vp, containerLen, d)
  8188. }
  8189. d.mapEnd()
  8190. }
  8191. }
  8192. func (fastpathT) DecMapIntUint8L(v map[int]uint8, containerLen int, d *Decoder) {
  8193. var mk int
  8194. var mv uint8
  8195. hasLen := containerLen > 0
  8196. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8197. d.mapElemKey()
  8198. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8199. d.mapElemValue()
  8200. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8201. if v != nil {
  8202. v[mk] = mv
  8203. }
  8204. }
  8205. }
  8206. func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) {
  8207. containerLen := d.mapStart()
  8208. if containerLen == decContainerLenNil {
  8209. if rv.Kind() == reflect.Ptr {
  8210. *(rv2i(rv).(*map[int]uint64)) = nil
  8211. }
  8212. } else {
  8213. if rv.Kind() == reflect.Ptr {
  8214. vp, _ := rv2i(rv).(*map[int]uint64)
  8215. if *vp == nil {
  8216. *vp = make(map[int]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8217. }
  8218. if containerLen != 0 {
  8219. fastpathTV.DecMapIntUint64L(*vp, containerLen, d)
  8220. }
  8221. } else if containerLen != 0 {
  8222. fastpathTV.DecMapIntUint64L(rv2i(rv).(map[int]uint64), containerLen, d)
  8223. }
  8224. d.mapEnd()
  8225. }
  8226. }
  8227. func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) {
  8228. containerLen := d.mapStart()
  8229. if containerLen == decContainerLenNil {
  8230. *vp = nil
  8231. } else {
  8232. if *vp == nil {
  8233. *vp = make(map[int]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8234. }
  8235. if containerLen != 0 {
  8236. f.DecMapIntUint64L(*vp, containerLen, d)
  8237. }
  8238. d.mapEnd()
  8239. }
  8240. }
  8241. func (fastpathT) DecMapIntUint64L(v map[int]uint64, containerLen int, d *Decoder) {
  8242. var mk int
  8243. var mv uint64
  8244. hasLen := containerLen > 0
  8245. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8246. d.mapElemKey()
  8247. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8248. d.mapElemValue()
  8249. mv = d.d.DecodeUint64()
  8250. if v != nil {
  8251. v[mk] = mv
  8252. }
  8253. }
  8254. }
  8255. func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) {
  8256. containerLen := d.mapStart()
  8257. if containerLen == decContainerLenNil {
  8258. if rv.Kind() == reflect.Ptr {
  8259. *(rv2i(rv).(*map[int]int)) = nil
  8260. }
  8261. } else {
  8262. if rv.Kind() == reflect.Ptr {
  8263. vp, _ := rv2i(rv).(*map[int]int)
  8264. if *vp == nil {
  8265. *vp = make(map[int]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8266. }
  8267. if containerLen != 0 {
  8268. fastpathTV.DecMapIntIntL(*vp, containerLen, d)
  8269. }
  8270. } else if containerLen != 0 {
  8271. fastpathTV.DecMapIntIntL(rv2i(rv).(map[int]int), containerLen, d)
  8272. }
  8273. d.mapEnd()
  8274. }
  8275. }
  8276. func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) {
  8277. containerLen := d.mapStart()
  8278. if containerLen == decContainerLenNil {
  8279. *vp = nil
  8280. } else {
  8281. if *vp == nil {
  8282. *vp = make(map[int]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8283. }
  8284. if containerLen != 0 {
  8285. f.DecMapIntIntL(*vp, containerLen, d)
  8286. }
  8287. d.mapEnd()
  8288. }
  8289. }
  8290. func (fastpathT) DecMapIntIntL(v map[int]int, containerLen int, d *Decoder) {
  8291. var mk int
  8292. var mv int
  8293. hasLen := containerLen > 0
  8294. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8295. d.mapElemKey()
  8296. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8297. d.mapElemValue()
  8298. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8299. if v != nil {
  8300. v[mk] = mv
  8301. }
  8302. }
  8303. }
  8304. func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) {
  8305. containerLen := d.mapStart()
  8306. if containerLen == decContainerLenNil {
  8307. if rv.Kind() == reflect.Ptr {
  8308. *(rv2i(rv).(*map[int]int64)) = nil
  8309. }
  8310. } else {
  8311. if rv.Kind() == reflect.Ptr {
  8312. vp, _ := rv2i(rv).(*map[int]int64)
  8313. if *vp == nil {
  8314. *vp = make(map[int]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8315. }
  8316. if containerLen != 0 {
  8317. fastpathTV.DecMapIntInt64L(*vp, containerLen, d)
  8318. }
  8319. } else if containerLen != 0 {
  8320. fastpathTV.DecMapIntInt64L(rv2i(rv).(map[int]int64), containerLen, d)
  8321. }
  8322. d.mapEnd()
  8323. }
  8324. }
  8325. func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) {
  8326. containerLen := d.mapStart()
  8327. if containerLen == decContainerLenNil {
  8328. *vp = nil
  8329. } else {
  8330. if *vp == nil {
  8331. *vp = make(map[int]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8332. }
  8333. if containerLen != 0 {
  8334. f.DecMapIntInt64L(*vp, containerLen, d)
  8335. }
  8336. d.mapEnd()
  8337. }
  8338. }
  8339. func (fastpathT) DecMapIntInt64L(v map[int]int64, containerLen int, d *Decoder) {
  8340. var mk int
  8341. var mv int64
  8342. hasLen := containerLen > 0
  8343. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8344. d.mapElemKey()
  8345. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8346. d.mapElemValue()
  8347. mv = d.d.DecodeInt64()
  8348. if v != nil {
  8349. v[mk] = mv
  8350. }
  8351. }
  8352. }
  8353. func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) {
  8354. containerLen := d.mapStart()
  8355. if containerLen == decContainerLenNil {
  8356. if rv.Kind() == reflect.Ptr {
  8357. *(rv2i(rv).(*map[int]float32)) = nil
  8358. }
  8359. } else {
  8360. if rv.Kind() == reflect.Ptr {
  8361. vp, _ := rv2i(rv).(*map[int]float32)
  8362. if *vp == nil {
  8363. *vp = make(map[int]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8364. }
  8365. if containerLen != 0 {
  8366. fastpathTV.DecMapIntFloat32L(*vp, containerLen, d)
  8367. }
  8368. } else if containerLen != 0 {
  8369. fastpathTV.DecMapIntFloat32L(rv2i(rv).(map[int]float32), containerLen, d)
  8370. }
  8371. d.mapEnd()
  8372. }
  8373. }
  8374. func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) {
  8375. containerLen := d.mapStart()
  8376. if containerLen == decContainerLenNil {
  8377. *vp = nil
  8378. } else {
  8379. if *vp == nil {
  8380. *vp = make(map[int]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8381. }
  8382. if containerLen != 0 {
  8383. f.DecMapIntFloat32L(*vp, containerLen, d)
  8384. }
  8385. d.mapEnd()
  8386. }
  8387. }
  8388. func (fastpathT) DecMapIntFloat32L(v map[int]float32, containerLen int, d *Decoder) {
  8389. var mk int
  8390. var mv float32
  8391. hasLen := containerLen > 0
  8392. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8393. d.mapElemKey()
  8394. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8395. d.mapElemValue()
  8396. mv = float32(d.decodeFloat32())
  8397. if v != nil {
  8398. v[mk] = mv
  8399. }
  8400. }
  8401. }
  8402. func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) {
  8403. containerLen := d.mapStart()
  8404. if containerLen == decContainerLenNil {
  8405. if rv.Kind() == reflect.Ptr {
  8406. *(rv2i(rv).(*map[int]float64)) = nil
  8407. }
  8408. } else {
  8409. if rv.Kind() == reflect.Ptr {
  8410. vp, _ := rv2i(rv).(*map[int]float64)
  8411. if *vp == nil {
  8412. *vp = make(map[int]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8413. }
  8414. if containerLen != 0 {
  8415. fastpathTV.DecMapIntFloat64L(*vp, containerLen, d)
  8416. }
  8417. } else if containerLen != 0 {
  8418. fastpathTV.DecMapIntFloat64L(rv2i(rv).(map[int]float64), containerLen, d)
  8419. }
  8420. d.mapEnd()
  8421. }
  8422. }
  8423. func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) {
  8424. containerLen := d.mapStart()
  8425. if containerLen == decContainerLenNil {
  8426. *vp = nil
  8427. } else {
  8428. if *vp == nil {
  8429. *vp = make(map[int]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8430. }
  8431. if containerLen != 0 {
  8432. f.DecMapIntFloat64L(*vp, containerLen, d)
  8433. }
  8434. d.mapEnd()
  8435. }
  8436. }
  8437. func (fastpathT) DecMapIntFloat64L(v map[int]float64, containerLen int, d *Decoder) {
  8438. var mk int
  8439. var mv float64
  8440. hasLen := containerLen > 0
  8441. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8442. d.mapElemKey()
  8443. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8444. d.mapElemValue()
  8445. mv = d.d.DecodeFloat64()
  8446. if v != nil {
  8447. v[mk] = mv
  8448. }
  8449. }
  8450. }
  8451. func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) {
  8452. containerLen := d.mapStart()
  8453. if containerLen == decContainerLenNil {
  8454. if rv.Kind() == reflect.Ptr {
  8455. *(rv2i(rv).(*map[int]bool)) = nil
  8456. }
  8457. } else {
  8458. if rv.Kind() == reflect.Ptr {
  8459. vp, _ := rv2i(rv).(*map[int]bool)
  8460. if *vp == nil {
  8461. *vp = make(map[int]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8462. }
  8463. if containerLen != 0 {
  8464. fastpathTV.DecMapIntBoolL(*vp, containerLen, d)
  8465. }
  8466. } else if containerLen != 0 {
  8467. fastpathTV.DecMapIntBoolL(rv2i(rv).(map[int]bool), containerLen, d)
  8468. }
  8469. d.mapEnd()
  8470. }
  8471. }
  8472. func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) {
  8473. containerLen := d.mapStart()
  8474. if containerLen == decContainerLenNil {
  8475. *vp = nil
  8476. } else {
  8477. if *vp == nil {
  8478. *vp = make(map[int]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8479. }
  8480. if containerLen != 0 {
  8481. f.DecMapIntBoolL(*vp, containerLen, d)
  8482. }
  8483. d.mapEnd()
  8484. }
  8485. }
  8486. func (fastpathT) DecMapIntBoolL(v map[int]bool, containerLen int, d *Decoder) {
  8487. var mk int
  8488. var mv bool
  8489. hasLen := containerLen > 0
  8490. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8491. d.mapElemKey()
  8492. mk = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8493. d.mapElemValue()
  8494. mv = d.d.DecodeBool()
  8495. if v != nil {
  8496. v[mk] = mv
  8497. }
  8498. }
  8499. }
  8500. func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) {
  8501. containerLen := d.mapStart()
  8502. if containerLen == decContainerLenNil {
  8503. if rv.Kind() == reflect.Ptr {
  8504. *(rv2i(rv).(*map[int64]interface{})) = nil
  8505. }
  8506. } else {
  8507. if rv.Kind() == reflect.Ptr {
  8508. vp, _ := rv2i(rv).(*map[int64]interface{})
  8509. if *vp == nil {
  8510. *vp = make(map[int64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8511. }
  8512. if containerLen != 0 {
  8513. fastpathTV.DecMapInt64IntfL(*vp, containerLen, d)
  8514. }
  8515. } else if containerLen != 0 {
  8516. fastpathTV.DecMapInt64IntfL(rv2i(rv).(map[int64]interface{}), containerLen, d)
  8517. }
  8518. d.mapEnd()
  8519. }
  8520. }
  8521. func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) {
  8522. containerLen := d.mapStart()
  8523. if containerLen == decContainerLenNil {
  8524. *vp = nil
  8525. } else {
  8526. if *vp == nil {
  8527. *vp = make(map[int64]interface{}, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8528. }
  8529. if containerLen != 0 {
  8530. f.DecMapInt64IntfL(*vp, containerLen, d)
  8531. }
  8532. d.mapEnd()
  8533. }
  8534. }
  8535. func (fastpathT) DecMapInt64IntfL(v map[int64]interface{}, containerLen int, d *Decoder) {
  8536. mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset
  8537. var mk int64
  8538. var mv interface{}
  8539. hasLen := containerLen > 0
  8540. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8541. d.mapElemKey()
  8542. mk = d.d.DecodeInt64()
  8543. d.mapElemValue()
  8544. if mapGet {
  8545. mv = v[mk]
  8546. } else {
  8547. mv = nil
  8548. }
  8549. d.decode(&mv)
  8550. if v != nil {
  8551. v[mk] = mv
  8552. }
  8553. }
  8554. }
  8555. func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) {
  8556. containerLen := d.mapStart()
  8557. if containerLen == decContainerLenNil {
  8558. if rv.Kind() == reflect.Ptr {
  8559. *(rv2i(rv).(*map[int64]string)) = nil
  8560. }
  8561. } else {
  8562. if rv.Kind() == reflect.Ptr {
  8563. vp, _ := rv2i(rv).(*map[int64]string)
  8564. if *vp == nil {
  8565. *vp = make(map[int64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8566. }
  8567. if containerLen != 0 {
  8568. fastpathTV.DecMapInt64StringL(*vp, containerLen, d)
  8569. }
  8570. } else if containerLen != 0 {
  8571. fastpathTV.DecMapInt64StringL(rv2i(rv).(map[int64]string), containerLen, d)
  8572. }
  8573. d.mapEnd()
  8574. }
  8575. }
  8576. func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) {
  8577. containerLen := d.mapStart()
  8578. if containerLen == decContainerLenNil {
  8579. *vp = nil
  8580. } else {
  8581. if *vp == nil {
  8582. *vp = make(map[int64]string, decInferLen(containerLen, d.h.MaxInitLen, 24))
  8583. }
  8584. if containerLen != 0 {
  8585. f.DecMapInt64StringL(*vp, containerLen, d)
  8586. }
  8587. d.mapEnd()
  8588. }
  8589. }
  8590. func (fastpathT) DecMapInt64StringL(v map[int64]string, containerLen int, d *Decoder) {
  8591. var mk int64
  8592. var mv string
  8593. hasLen := containerLen > 0
  8594. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8595. d.mapElemKey()
  8596. mk = d.d.DecodeInt64()
  8597. d.mapElemValue()
  8598. mv = string(d.d.DecodeStringAsBytes())
  8599. if v != nil {
  8600. v[mk] = mv
  8601. }
  8602. }
  8603. }
  8604. func (d *Decoder) fastpathDecMapInt64BytesR(f *codecFnInfo, rv reflect.Value) {
  8605. containerLen := d.mapStart()
  8606. if containerLen == decContainerLenNil {
  8607. if rv.Kind() == reflect.Ptr {
  8608. *(rv2i(rv).(*map[int64][]byte)) = nil
  8609. }
  8610. } else {
  8611. if rv.Kind() == reflect.Ptr {
  8612. vp, _ := rv2i(rv).(*map[int64][]byte)
  8613. if *vp == nil {
  8614. *vp = make(map[int64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8615. }
  8616. if containerLen != 0 {
  8617. fastpathTV.DecMapInt64BytesL(*vp, containerLen, d)
  8618. }
  8619. } else if containerLen != 0 {
  8620. fastpathTV.DecMapInt64BytesL(rv2i(rv).(map[int64][]byte), containerLen, d)
  8621. }
  8622. d.mapEnd()
  8623. }
  8624. }
  8625. func (f fastpathT) DecMapInt64BytesX(vp *map[int64][]byte, d *Decoder) {
  8626. containerLen := d.mapStart()
  8627. if containerLen == decContainerLenNil {
  8628. *vp = nil
  8629. } else {
  8630. if *vp == nil {
  8631. *vp = make(map[int64][]byte, decInferLen(containerLen, d.h.MaxInitLen, 32))
  8632. }
  8633. if containerLen != 0 {
  8634. f.DecMapInt64BytesL(*vp, containerLen, d)
  8635. }
  8636. d.mapEnd()
  8637. }
  8638. }
  8639. func (fastpathT) DecMapInt64BytesL(v map[int64][]byte, containerLen int, d *Decoder) {
  8640. mapGet := v != nil && !d.h.MapValueReset
  8641. var mk int64
  8642. var mv []byte
  8643. hasLen := containerLen > 0
  8644. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8645. d.mapElemKey()
  8646. mk = d.d.DecodeInt64()
  8647. d.mapElemValue()
  8648. if mapGet {
  8649. mv = v[mk]
  8650. } else {
  8651. mv = nil
  8652. }
  8653. mv = d.d.DecodeBytes(mv, false)
  8654. if v != nil {
  8655. v[mk] = mv
  8656. }
  8657. }
  8658. }
  8659. func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) {
  8660. containerLen := d.mapStart()
  8661. if containerLen == decContainerLenNil {
  8662. if rv.Kind() == reflect.Ptr {
  8663. *(rv2i(rv).(*map[int64]uint)) = nil
  8664. }
  8665. } else {
  8666. if rv.Kind() == reflect.Ptr {
  8667. vp, _ := rv2i(rv).(*map[int64]uint)
  8668. if *vp == nil {
  8669. *vp = make(map[int64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8670. }
  8671. if containerLen != 0 {
  8672. fastpathTV.DecMapInt64UintL(*vp, containerLen, d)
  8673. }
  8674. } else if containerLen != 0 {
  8675. fastpathTV.DecMapInt64UintL(rv2i(rv).(map[int64]uint), containerLen, d)
  8676. }
  8677. d.mapEnd()
  8678. }
  8679. }
  8680. func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) {
  8681. containerLen := d.mapStart()
  8682. if containerLen == decContainerLenNil {
  8683. *vp = nil
  8684. } else {
  8685. if *vp == nil {
  8686. *vp = make(map[int64]uint, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8687. }
  8688. if containerLen != 0 {
  8689. f.DecMapInt64UintL(*vp, containerLen, d)
  8690. }
  8691. d.mapEnd()
  8692. }
  8693. }
  8694. func (fastpathT) DecMapInt64UintL(v map[int64]uint, containerLen int, d *Decoder) {
  8695. var mk int64
  8696. var mv uint
  8697. hasLen := containerLen > 0
  8698. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8699. d.mapElemKey()
  8700. mk = d.d.DecodeInt64()
  8701. d.mapElemValue()
  8702. mv = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize))
  8703. if v != nil {
  8704. v[mk] = mv
  8705. }
  8706. }
  8707. }
  8708. func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) {
  8709. containerLen := d.mapStart()
  8710. if containerLen == decContainerLenNil {
  8711. if rv.Kind() == reflect.Ptr {
  8712. *(rv2i(rv).(*map[int64]uint8)) = nil
  8713. }
  8714. } else {
  8715. if rv.Kind() == reflect.Ptr {
  8716. vp, _ := rv2i(rv).(*map[int64]uint8)
  8717. if *vp == nil {
  8718. *vp = make(map[int64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8719. }
  8720. if containerLen != 0 {
  8721. fastpathTV.DecMapInt64Uint8L(*vp, containerLen, d)
  8722. }
  8723. } else if containerLen != 0 {
  8724. fastpathTV.DecMapInt64Uint8L(rv2i(rv).(map[int64]uint8), containerLen, d)
  8725. }
  8726. d.mapEnd()
  8727. }
  8728. }
  8729. func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) {
  8730. containerLen := d.mapStart()
  8731. if containerLen == decContainerLenNil {
  8732. *vp = nil
  8733. } else {
  8734. if *vp == nil {
  8735. *vp = make(map[int64]uint8, decInferLen(containerLen, d.h.MaxInitLen, 9))
  8736. }
  8737. if containerLen != 0 {
  8738. f.DecMapInt64Uint8L(*vp, containerLen, d)
  8739. }
  8740. d.mapEnd()
  8741. }
  8742. }
  8743. func (fastpathT) DecMapInt64Uint8L(v map[int64]uint8, containerLen int, d *Decoder) {
  8744. var mk int64
  8745. var mv uint8
  8746. hasLen := containerLen > 0
  8747. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8748. d.mapElemKey()
  8749. mk = d.d.DecodeInt64()
  8750. d.mapElemValue()
  8751. mv = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8))
  8752. if v != nil {
  8753. v[mk] = mv
  8754. }
  8755. }
  8756. }
  8757. func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) {
  8758. containerLen := d.mapStart()
  8759. if containerLen == decContainerLenNil {
  8760. if rv.Kind() == reflect.Ptr {
  8761. *(rv2i(rv).(*map[int64]uint64)) = nil
  8762. }
  8763. } else {
  8764. if rv.Kind() == reflect.Ptr {
  8765. vp, _ := rv2i(rv).(*map[int64]uint64)
  8766. if *vp == nil {
  8767. *vp = make(map[int64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8768. }
  8769. if containerLen != 0 {
  8770. fastpathTV.DecMapInt64Uint64L(*vp, containerLen, d)
  8771. }
  8772. } else if containerLen != 0 {
  8773. fastpathTV.DecMapInt64Uint64L(rv2i(rv).(map[int64]uint64), containerLen, d)
  8774. }
  8775. d.mapEnd()
  8776. }
  8777. }
  8778. func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) {
  8779. containerLen := d.mapStart()
  8780. if containerLen == decContainerLenNil {
  8781. *vp = nil
  8782. } else {
  8783. if *vp == nil {
  8784. *vp = make(map[int64]uint64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8785. }
  8786. if containerLen != 0 {
  8787. f.DecMapInt64Uint64L(*vp, containerLen, d)
  8788. }
  8789. d.mapEnd()
  8790. }
  8791. }
  8792. func (fastpathT) DecMapInt64Uint64L(v map[int64]uint64, containerLen int, d *Decoder) {
  8793. var mk int64
  8794. var mv uint64
  8795. hasLen := containerLen > 0
  8796. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8797. d.mapElemKey()
  8798. mk = d.d.DecodeInt64()
  8799. d.mapElemValue()
  8800. mv = d.d.DecodeUint64()
  8801. if v != nil {
  8802. v[mk] = mv
  8803. }
  8804. }
  8805. }
  8806. func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) {
  8807. containerLen := d.mapStart()
  8808. if containerLen == decContainerLenNil {
  8809. if rv.Kind() == reflect.Ptr {
  8810. *(rv2i(rv).(*map[int64]int)) = nil
  8811. }
  8812. } else {
  8813. if rv.Kind() == reflect.Ptr {
  8814. vp, _ := rv2i(rv).(*map[int64]int)
  8815. if *vp == nil {
  8816. *vp = make(map[int64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8817. }
  8818. if containerLen != 0 {
  8819. fastpathTV.DecMapInt64IntL(*vp, containerLen, d)
  8820. }
  8821. } else if containerLen != 0 {
  8822. fastpathTV.DecMapInt64IntL(rv2i(rv).(map[int64]int), containerLen, d)
  8823. }
  8824. d.mapEnd()
  8825. }
  8826. }
  8827. func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) {
  8828. containerLen := d.mapStart()
  8829. if containerLen == decContainerLenNil {
  8830. *vp = nil
  8831. } else {
  8832. if *vp == nil {
  8833. *vp = make(map[int64]int, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8834. }
  8835. if containerLen != 0 {
  8836. f.DecMapInt64IntL(*vp, containerLen, d)
  8837. }
  8838. d.mapEnd()
  8839. }
  8840. }
  8841. func (fastpathT) DecMapInt64IntL(v map[int64]int, containerLen int, d *Decoder) {
  8842. var mk int64
  8843. var mv int
  8844. hasLen := containerLen > 0
  8845. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8846. d.mapElemKey()
  8847. mk = d.d.DecodeInt64()
  8848. d.mapElemValue()
  8849. mv = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize))
  8850. if v != nil {
  8851. v[mk] = mv
  8852. }
  8853. }
  8854. }
  8855. func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) {
  8856. containerLen := d.mapStart()
  8857. if containerLen == decContainerLenNil {
  8858. if rv.Kind() == reflect.Ptr {
  8859. *(rv2i(rv).(*map[int64]int64)) = nil
  8860. }
  8861. } else {
  8862. if rv.Kind() == reflect.Ptr {
  8863. vp, _ := rv2i(rv).(*map[int64]int64)
  8864. if *vp == nil {
  8865. *vp = make(map[int64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8866. }
  8867. if containerLen != 0 {
  8868. fastpathTV.DecMapInt64Int64L(*vp, containerLen, d)
  8869. }
  8870. } else if containerLen != 0 {
  8871. fastpathTV.DecMapInt64Int64L(rv2i(rv).(map[int64]int64), containerLen, d)
  8872. }
  8873. d.mapEnd()
  8874. }
  8875. }
  8876. func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) {
  8877. containerLen := d.mapStart()
  8878. if containerLen == decContainerLenNil {
  8879. *vp = nil
  8880. } else {
  8881. if *vp == nil {
  8882. *vp = make(map[int64]int64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8883. }
  8884. if containerLen != 0 {
  8885. f.DecMapInt64Int64L(*vp, containerLen, d)
  8886. }
  8887. d.mapEnd()
  8888. }
  8889. }
  8890. func (fastpathT) DecMapInt64Int64L(v map[int64]int64, containerLen int, d *Decoder) {
  8891. var mk int64
  8892. var mv int64
  8893. hasLen := containerLen > 0
  8894. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8895. d.mapElemKey()
  8896. mk = d.d.DecodeInt64()
  8897. d.mapElemValue()
  8898. mv = d.d.DecodeInt64()
  8899. if v != nil {
  8900. v[mk] = mv
  8901. }
  8902. }
  8903. }
  8904. func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) {
  8905. containerLen := d.mapStart()
  8906. if containerLen == decContainerLenNil {
  8907. if rv.Kind() == reflect.Ptr {
  8908. *(rv2i(rv).(*map[int64]float32)) = nil
  8909. }
  8910. } else {
  8911. if rv.Kind() == reflect.Ptr {
  8912. vp, _ := rv2i(rv).(*map[int64]float32)
  8913. if *vp == nil {
  8914. *vp = make(map[int64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8915. }
  8916. if containerLen != 0 {
  8917. fastpathTV.DecMapInt64Float32L(*vp, containerLen, d)
  8918. }
  8919. } else if containerLen != 0 {
  8920. fastpathTV.DecMapInt64Float32L(rv2i(rv).(map[int64]float32), containerLen, d)
  8921. }
  8922. d.mapEnd()
  8923. }
  8924. }
  8925. func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) {
  8926. containerLen := d.mapStart()
  8927. if containerLen == decContainerLenNil {
  8928. *vp = nil
  8929. } else {
  8930. if *vp == nil {
  8931. *vp = make(map[int64]float32, decInferLen(containerLen, d.h.MaxInitLen, 12))
  8932. }
  8933. if containerLen != 0 {
  8934. f.DecMapInt64Float32L(*vp, containerLen, d)
  8935. }
  8936. d.mapEnd()
  8937. }
  8938. }
  8939. func (fastpathT) DecMapInt64Float32L(v map[int64]float32, containerLen int, d *Decoder) {
  8940. var mk int64
  8941. var mv float32
  8942. hasLen := containerLen > 0
  8943. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8944. d.mapElemKey()
  8945. mk = d.d.DecodeInt64()
  8946. d.mapElemValue()
  8947. mv = float32(d.decodeFloat32())
  8948. if v != nil {
  8949. v[mk] = mv
  8950. }
  8951. }
  8952. }
  8953. func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) {
  8954. containerLen := d.mapStart()
  8955. if containerLen == decContainerLenNil {
  8956. if rv.Kind() == reflect.Ptr {
  8957. *(rv2i(rv).(*map[int64]float64)) = nil
  8958. }
  8959. } else {
  8960. if rv.Kind() == reflect.Ptr {
  8961. vp, _ := rv2i(rv).(*map[int64]float64)
  8962. if *vp == nil {
  8963. *vp = make(map[int64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8964. }
  8965. if containerLen != 0 {
  8966. fastpathTV.DecMapInt64Float64L(*vp, containerLen, d)
  8967. }
  8968. } else if containerLen != 0 {
  8969. fastpathTV.DecMapInt64Float64L(rv2i(rv).(map[int64]float64), containerLen, d)
  8970. }
  8971. d.mapEnd()
  8972. }
  8973. }
  8974. func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) {
  8975. containerLen := d.mapStart()
  8976. if containerLen == decContainerLenNil {
  8977. *vp = nil
  8978. } else {
  8979. if *vp == nil {
  8980. *vp = make(map[int64]float64, decInferLen(containerLen, d.h.MaxInitLen, 16))
  8981. }
  8982. if containerLen != 0 {
  8983. f.DecMapInt64Float64L(*vp, containerLen, d)
  8984. }
  8985. d.mapEnd()
  8986. }
  8987. }
  8988. func (fastpathT) DecMapInt64Float64L(v map[int64]float64, containerLen int, d *Decoder) {
  8989. var mk int64
  8990. var mv float64
  8991. hasLen := containerLen > 0
  8992. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  8993. d.mapElemKey()
  8994. mk = d.d.DecodeInt64()
  8995. d.mapElemValue()
  8996. mv = d.d.DecodeFloat64()
  8997. if v != nil {
  8998. v[mk] = mv
  8999. }
  9000. }
  9001. }
  9002. func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) {
  9003. containerLen := d.mapStart()
  9004. if containerLen == decContainerLenNil {
  9005. if rv.Kind() == reflect.Ptr {
  9006. *(rv2i(rv).(*map[int64]bool)) = nil
  9007. }
  9008. } else {
  9009. if rv.Kind() == reflect.Ptr {
  9010. vp, _ := rv2i(rv).(*map[int64]bool)
  9011. if *vp == nil {
  9012. *vp = make(map[int64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  9013. }
  9014. if containerLen != 0 {
  9015. fastpathTV.DecMapInt64BoolL(*vp, containerLen, d)
  9016. }
  9017. } else if containerLen != 0 {
  9018. fastpathTV.DecMapInt64BoolL(rv2i(rv).(map[int64]bool), containerLen, d)
  9019. }
  9020. d.mapEnd()
  9021. }
  9022. }
  9023. func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) {
  9024. containerLen := d.mapStart()
  9025. if containerLen == decContainerLenNil {
  9026. *vp = nil
  9027. } else {
  9028. if *vp == nil {
  9029. *vp = make(map[int64]bool, decInferLen(containerLen, d.h.MaxInitLen, 9))
  9030. }
  9031. if containerLen != 0 {
  9032. f.DecMapInt64BoolL(*vp, containerLen, d)
  9033. }
  9034. d.mapEnd()
  9035. }
  9036. }
  9037. func (fastpathT) DecMapInt64BoolL(v map[int64]bool, containerLen int, d *Decoder) {
  9038. var mk int64
  9039. var mv bool
  9040. hasLen := containerLen > 0
  9041. for j := 0; (hasLen && j < containerLen) || !(hasLen || d.d.CheckBreak()); j++ {
  9042. d.mapElemKey()
  9043. mk = d.d.DecodeInt64()
  9044. d.mapElemValue()
  9045. mv = d.d.DecodeBool()
  9046. if v != nil {
  9047. v[mk] = mv
  9048. }
  9049. }
  9050. }