fast-path.generated.go 220 KB

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