本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1127 lines
23KB

  1. package roaring
  2. // NOTE: THIS FILE WAS PRODUCED BY THE
  3. // MSGP CODE GENERATION TOOL (github.com/tinylib/msgp)
  4. // DO NOT EDIT
  5. import "github.com/tinylib/msgp/msgp"
  6. // DecodeMsg implements msgp.Decodable
  7. func (z *addHelper16) DecodeMsg(dc *msgp.Reader) (err error) {
  8. var field []byte
  9. _ = field
  10. var zbai uint32
  11. zbai, err = dc.ReadMapHeader()
  12. if err != nil {
  13. return
  14. }
  15. for zbai > 0 {
  16. zbai--
  17. field, err = dc.ReadMapKeyPtr()
  18. if err != nil {
  19. return
  20. }
  21. switch msgp.UnsafeString(field) {
  22. case "runstart":
  23. z.runstart, err = dc.ReadUint16()
  24. if err != nil {
  25. return
  26. }
  27. case "runlen":
  28. z.runlen, err = dc.ReadUint16()
  29. if err != nil {
  30. return
  31. }
  32. case "actuallyAdded":
  33. z.actuallyAdded, err = dc.ReadUint16()
  34. if err != nil {
  35. return
  36. }
  37. case "m":
  38. var zcmr uint32
  39. zcmr, err = dc.ReadArrayHeader()
  40. if err != nil {
  41. return
  42. }
  43. if cap(z.m) >= int(zcmr) {
  44. z.m = (z.m)[:zcmr]
  45. } else {
  46. z.m = make([]interval16, zcmr)
  47. }
  48. for zxvk := range z.m {
  49. var zajw uint32
  50. zajw, err = dc.ReadMapHeader()
  51. if err != nil {
  52. return
  53. }
  54. for zajw > 0 {
  55. zajw--
  56. field, err = dc.ReadMapKeyPtr()
  57. if err != nil {
  58. return
  59. }
  60. switch msgp.UnsafeString(field) {
  61. case "start":
  62. z.m[zxvk].start, err = dc.ReadUint16()
  63. if err != nil {
  64. return
  65. }
  66. case "last":
  67. z.m[zxvk].length, err = dc.ReadUint16()
  68. z.m[zxvk].length -= z.m[zxvk].start
  69. if err != nil {
  70. return
  71. }
  72. default:
  73. err = dc.Skip()
  74. if err != nil {
  75. return
  76. }
  77. }
  78. }
  79. }
  80. case "rc":
  81. if dc.IsNil() {
  82. err = dc.ReadNil()
  83. if err != nil {
  84. return
  85. }
  86. z.rc = nil
  87. } else {
  88. if z.rc == nil {
  89. z.rc = new(runContainer16)
  90. }
  91. var zwht uint32
  92. zwht, err = dc.ReadMapHeader()
  93. if err != nil {
  94. return
  95. }
  96. for zwht > 0 {
  97. zwht--
  98. field, err = dc.ReadMapKeyPtr()
  99. if err != nil {
  100. return
  101. }
  102. switch msgp.UnsafeString(field) {
  103. case "iv":
  104. var zhct uint32
  105. zhct, err = dc.ReadArrayHeader()
  106. if err != nil {
  107. return
  108. }
  109. if cap(z.rc.iv) >= int(zhct) {
  110. z.rc.iv = (z.rc.iv)[:zhct]
  111. } else {
  112. z.rc.iv = make([]interval16, zhct)
  113. }
  114. for zbzg := range z.rc.iv {
  115. var zcua uint32
  116. zcua, err = dc.ReadMapHeader()
  117. if err != nil {
  118. return
  119. }
  120. for zcua > 0 {
  121. zcua--
  122. field, err = dc.ReadMapKeyPtr()
  123. if err != nil {
  124. return
  125. }
  126. switch msgp.UnsafeString(field) {
  127. case "start":
  128. z.rc.iv[zbzg].start, err = dc.ReadUint16()
  129. if err != nil {
  130. return
  131. }
  132. case "last":
  133. z.rc.iv[zbzg].length, err = dc.ReadUint16()
  134. z.rc.iv[zbzg].length -= z.rc.iv[zbzg].start
  135. if err != nil {
  136. return
  137. }
  138. default:
  139. err = dc.Skip()
  140. if err != nil {
  141. return
  142. }
  143. }
  144. }
  145. }
  146. case "card":
  147. z.rc.card, err = dc.ReadInt64()
  148. if err != nil {
  149. return
  150. }
  151. default:
  152. err = dc.Skip()
  153. if err != nil {
  154. return
  155. }
  156. }
  157. }
  158. }
  159. default:
  160. err = dc.Skip()
  161. if err != nil {
  162. return
  163. }
  164. }
  165. }
  166. return
  167. }
  168. // EncodeMsg implements msgp.Encodable
  169. func (z *addHelper16) EncodeMsg(en *msgp.Writer) (err error) {
  170. // map header, size 5
  171. // write "runstart"
  172. err = en.Append(0x85, 0xa8, 0x72, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x72, 0x74)
  173. if err != nil {
  174. return err
  175. }
  176. err = en.WriteUint16(z.runstart)
  177. if err != nil {
  178. return
  179. }
  180. // write "runlen"
  181. err = en.Append(0xa6, 0x72, 0x75, 0x6e, 0x6c, 0x65, 0x6e)
  182. if err != nil {
  183. return err
  184. }
  185. err = en.WriteUint16(z.runlen)
  186. if err != nil {
  187. return
  188. }
  189. // write "actuallyAdded"
  190. err = en.Append(0xad, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x41, 0x64, 0x64, 0x65, 0x64)
  191. if err != nil {
  192. return err
  193. }
  194. err = en.WriteUint16(z.actuallyAdded)
  195. if err != nil {
  196. return
  197. }
  198. // write "m"
  199. err = en.Append(0xa1, 0x6d)
  200. if err != nil {
  201. return err
  202. }
  203. err = en.WriteArrayHeader(uint32(len(z.m)))
  204. if err != nil {
  205. return
  206. }
  207. for zxvk := range z.m {
  208. // map header, size 2
  209. // write "start"
  210. err = en.Append(0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  211. if err != nil {
  212. return err
  213. }
  214. err = en.WriteUint16(z.m[zxvk].start)
  215. if err != nil {
  216. return
  217. }
  218. // write "last"
  219. err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
  220. if err != nil {
  221. return err
  222. }
  223. err = en.WriteUint16(z.m[zxvk].last())
  224. if err != nil {
  225. return
  226. }
  227. }
  228. // write "rc"
  229. err = en.Append(0xa2, 0x72, 0x63)
  230. if err != nil {
  231. return err
  232. }
  233. if z.rc == nil {
  234. err = en.WriteNil()
  235. if err != nil {
  236. return
  237. }
  238. } else {
  239. // map header, size 2
  240. // write "iv"
  241. err = en.Append(0x82, 0xa2, 0x69, 0x76)
  242. if err != nil {
  243. return err
  244. }
  245. err = en.WriteArrayHeader(uint32(len(z.rc.iv)))
  246. if err != nil {
  247. return
  248. }
  249. for zbzg := range z.rc.iv {
  250. // map header, size 2
  251. // write "start"
  252. err = en.Append(0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  253. if err != nil {
  254. return err
  255. }
  256. err = en.WriteUint16(z.rc.iv[zbzg].start)
  257. if err != nil {
  258. return
  259. }
  260. // write "last"
  261. err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
  262. if err != nil {
  263. return err
  264. }
  265. err = en.WriteUint16(z.rc.iv[zbzg].last())
  266. if err != nil {
  267. return
  268. }
  269. }
  270. // write "card"
  271. err = en.Append(0xa4, 0x63, 0x61, 0x72, 0x64)
  272. if err != nil {
  273. return err
  274. }
  275. err = en.WriteInt64(z.rc.card)
  276. if err != nil {
  277. return
  278. }
  279. }
  280. return
  281. }
  282. // MarshalMsg implements msgp.Marshaler
  283. func (z *addHelper16) MarshalMsg(b []byte) (o []byte, err error) {
  284. o = msgp.Require(b, z.Msgsize())
  285. // map header, size 5
  286. // string "runstart"
  287. o = append(o, 0x85, 0xa8, 0x72, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x72, 0x74)
  288. o = msgp.AppendUint16(o, z.runstart)
  289. // string "runlen"
  290. o = append(o, 0xa6, 0x72, 0x75, 0x6e, 0x6c, 0x65, 0x6e)
  291. o = msgp.AppendUint16(o, z.runlen)
  292. // string "actuallyAdded"
  293. o = append(o, 0xad, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x41, 0x64, 0x64, 0x65, 0x64)
  294. o = msgp.AppendUint16(o, z.actuallyAdded)
  295. // string "m"
  296. o = append(o, 0xa1, 0x6d)
  297. o = msgp.AppendArrayHeader(o, uint32(len(z.m)))
  298. for zxvk := range z.m {
  299. // map header, size 2
  300. // string "start"
  301. o = append(o, 0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  302. o = msgp.AppendUint16(o, z.m[zxvk].start)
  303. // string "last"
  304. o = append(o, 0xa4, 0x6c, 0x61, 0x73, 0x74)
  305. o = msgp.AppendUint16(o, z.m[zxvk].last())
  306. }
  307. // string "rc"
  308. o = append(o, 0xa2, 0x72, 0x63)
  309. if z.rc == nil {
  310. o = msgp.AppendNil(o)
  311. } else {
  312. // map header, size 2
  313. // string "iv"
  314. o = append(o, 0x82, 0xa2, 0x69, 0x76)
  315. o = msgp.AppendArrayHeader(o, uint32(len(z.rc.iv)))
  316. for zbzg := range z.rc.iv {
  317. // map header, size 2
  318. // string "start"
  319. o = append(o, 0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  320. o = msgp.AppendUint16(o, z.rc.iv[zbzg].start)
  321. // string "last"
  322. o = append(o, 0xa4, 0x6c, 0x61, 0x73, 0x74)
  323. o = msgp.AppendUint16(o, z.rc.iv[zbzg].last())
  324. }
  325. // string "card"
  326. o = append(o, 0xa4, 0x63, 0x61, 0x72, 0x64)
  327. o = msgp.AppendInt64(o, z.rc.card)
  328. }
  329. return
  330. }
  331. // UnmarshalMsg implements msgp.Unmarshaler
  332. func (z *addHelper16) UnmarshalMsg(bts []byte) (o []byte, err error) {
  333. var field []byte
  334. _ = field
  335. var zxhx uint32
  336. zxhx, bts, err = msgp.ReadMapHeaderBytes(bts)
  337. if err != nil {
  338. return
  339. }
  340. for zxhx > 0 {
  341. zxhx--
  342. field, bts, err = msgp.ReadMapKeyZC(bts)
  343. if err != nil {
  344. return
  345. }
  346. switch msgp.UnsafeString(field) {
  347. case "runstart":
  348. z.runstart, bts, err = msgp.ReadUint16Bytes(bts)
  349. if err != nil {
  350. return
  351. }
  352. case "runlen":
  353. z.runlen, bts, err = msgp.ReadUint16Bytes(bts)
  354. if err != nil {
  355. return
  356. }
  357. case "actuallyAdded":
  358. z.actuallyAdded, bts, err = msgp.ReadUint16Bytes(bts)
  359. if err != nil {
  360. return
  361. }
  362. case "m":
  363. var zlqf uint32
  364. zlqf, bts, err = msgp.ReadArrayHeaderBytes(bts)
  365. if err != nil {
  366. return
  367. }
  368. if cap(z.m) >= int(zlqf) {
  369. z.m = (z.m)[:zlqf]
  370. } else {
  371. z.m = make([]interval16, zlqf)
  372. }
  373. for zxvk := range z.m {
  374. var zdaf uint32
  375. zdaf, bts, err = msgp.ReadMapHeaderBytes(bts)
  376. if err != nil {
  377. return
  378. }
  379. for zdaf > 0 {
  380. zdaf--
  381. field, bts, err = msgp.ReadMapKeyZC(bts)
  382. if err != nil {
  383. return
  384. }
  385. switch msgp.UnsafeString(field) {
  386. case "start":
  387. z.m[zxvk].start, bts, err = msgp.ReadUint16Bytes(bts)
  388. if err != nil {
  389. return
  390. }
  391. case "last":
  392. z.m[zxvk].length, bts, err = msgp.ReadUint16Bytes(bts)
  393. z.m[zxvk].length -= z.m[zxvk].start
  394. if err != nil {
  395. return
  396. }
  397. default:
  398. bts, err = msgp.Skip(bts)
  399. if err != nil {
  400. return
  401. }
  402. }
  403. }
  404. }
  405. case "rc":
  406. if msgp.IsNil(bts) {
  407. bts, err = msgp.ReadNilBytes(bts)
  408. if err != nil {
  409. return
  410. }
  411. z.rc = nil
  412. } else {
  413. if z.rc == nil {
  414. z.rc = new(runContainer16)
  415. }
  416. var zpks uint32
  417. zpks, bts, err = msgp.ReadMapHeaderBytes(bts)
  418. if err != nil {
  419. return
  420. }
  421. for zpks > 0 {
  422. zpks--
  423. field, bts, err = msgp.ReadMapKeyZC(bts)
  424. if err != nil {
  425. return
  426. }
  427. switch msgp.UnsafeString(field) {
  428. case "iv":
  429. var zjfb uint32
  430. zjfb, bts, err = msgp.ReadArrayHeaderBytes(bts)
  431. if err != nil {
  432. return
  433. }
  434. if cap(z.rc.iv) >= int(zjfb) {
  435. z.rc.iv = (z.rc.iv)[:zjfb]
  436. } else {
  437. z.rc.iv = make([]interval16, zjfb)
  438. }
  439. for zbzg := range z.rc.iv {
  440. var zcxo uint32
  441. zcxo, bts, err = msgp.ReadMapHeaderBytes(bts)
  442. if err != nil {
  443. return
  444. }
  445. for zcxo > 0 {
  446. zcxo--
  447. field, bts, err = msgp.ReadMapKeyZC(bts)
  448. if err != nil {
  449. return
  450. }
  451. switch msgp.UnsafeString(field) {
  452. case "start":
  453. z.rc.iv[zbzg].start, bts, err = msgp.ReadUint16Bytes(bts)
  454. if err != nil {
  455. return
  456. }
  457. case "last":
  458. z.rc.iv[zbzg].length, bts, err = msgp.ReadUint16Bytes(bts)
  459. z.rc.iv[zbzg].length -= z.rc.iv[zbzg].start
  460. if err != nil {
  461. return
  462. }
  463. default:
  464. bts, err = msgp.Skip(bts)
  465. if err != nil {
  466. return
  467. }
  468. }
  469. }
  470. }
  471. case "card":
  472. z.rc.card, bts, err = msgp.ReadInt64Bytes(bts)
  473. if err != nil {
  474. return
  475. }
  476. default:
  477. bts, err = msgp.Skip(bts)
  478. if err != nil {
  479. return
  480. }
  481. }
  482. }
  483. }
  484. default:
  485. bts, err = msgp.Skip(bts)
  486. if err != nil {
  487. return
  488. }
  489. }
  490. }
  491. o = bts
  492. return
  493. }
  494. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  495. func (z *addHelper16) Msgsize() (s int) {
  496. s = 1 + 9 + msgp.Uint16Size + 7 + msgp.Uint16Size + 14 + msgp.Uint16Size + 2 + msgp.ArrayHeaderSize + (len(z.m) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 3
  497. if z.rc == nil {
  498. s += msgp.NilSize
  499. } else {
  500. s += 1 + 3 + msgp.ArrayHeaderSize + (len(z.rc.iv) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 5 + msgp.Int64Size
  501. }
  502. return
  503. }
  504. // DecodeMsg implements msgp.Decodable
  505. func (z *interval16) DecodeMsg(dc *msgp.Reader) (err error) {
  506. var field []byte
  507. _ = field
  508. var zeff uint32
  509. zeff, err = dc.ReadMapHeader()
  510. if err != nil {
  511. return
  512. }
  513. for zeff > 0 {
  514. zeff--
  515. field, err = dc.ReadMapKeyPtr()
  516. if err != nil {
  517. return
  518. }
  519. switch msgp.UnsafeString(field) {
  520. case "start":
  521. z.start, err = dc.ReadUint16()
  522. if err != nil {
  523. return
  524. }
  525. case "last":
  526. z.length, err = dc.ReadUint16()
  527. z.length = -z.start
  528. if err != nil {
  529. return
  530. }
  531. default:
  532. err = dc.Skip()
  533. if err != nil {
  534. return
  535. }
  536. }
  537. }
  538. return
  539. }
  540. // EncodeMsg implements msgp.Encodable
  541. func (z interval16) EncodeMsg(en *msgp.Writer) (err error) {
  542. // map header, size 2
  543. // write "start"
  544. err = en.Append(0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  545. if err != nil {
  546. return err
  547. }
  548. err = en.WriteUint16(z.start)
  549. if err != nil {
  550. return
  551. }
  552. // write "last"
  553. err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
  554. if err != nil {
  555. return err
  556. }
  557. err = en.WriteUint16(z.last())
  558. if err != nil {
  559. return
  560. }
  561. return
  562. }
  563. // MarshalMsg implements msgp.Marshaler
  564. func (z interval16) MarshalMsg(b []byte) (o []byte, err error) {
  565. o = msgp.Require(b, z.Msgsize())
  566. // map header, size 2
  567. // string "start"
  568. o = append(o, 0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  569. o = msgp.AppendUint16(o, z.start)
  570. // string "last"
  571. o = append(o, 0xa4, 0x6c, 0x61, 0x73, 0x74)
  572. o = msgp.AppendUint16(o, z.last())
  573. return
  574. }
  575. // UnmarshalMsg implements msgp.Unmarshaler
  576. func (z *interval16) UnmarshalMsg(bts []byte) (o []byte, err error) {
  577. var field []byte
  578. _ = field
  579. var zrsw uint32
  580. zrsw, bts, err = msgp.ReadMapHeaderBytes(bts)
  581. if err != nil {
  582. return
  583. }
  584. for zrsw > 0 {
  585. zrsw--
  586. field, bts, err = msgp.ReadMapKeyZC(bts)
  587. if err != nil {
  588. return
  589. }
  590. switch msgp.UnsafeString(field) {
  591. case "start":
  592. z.start, bts, err = msgp.ReadUint16Bytes(bts)
  593. if err != nil {
  594. return
  595. }
  596. case "last":
  597. z.length, bts, err = msgp.ReadUint16Bytes(bts)
  598. z.length -= z.start
  599. if err != nil {
  600. return
  601. }
  602. default:
  603. bts, err = msgp.Skip(bts)
  604. if err != nil {
  605. return
  606. }
  607. }
  608. }
  609. o = bts
  610. return
  611. }
  612. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  613. func (z interval16) Msgsize() (s int) {
  614. s = 1 + 6 + msgp.Uint16Size + 5 + msgp.Uint16Size
  615. return
  616. }
  617. // DecodeMsg implements msgp.Decodable
  618. func (z *runContainer16) DecodeMsg(dc *msgp.Reader) (err error) {
  619. var field []byte
  620. _ = field
  621. var zdnj uint32
  622. zdnj, err = dc.ReadMapHeader()
  623. if err != nil {
  624. return
  625. }
  626. for zdnj > 0 {
  627. zdnj--
  628. field, err = dc.ReadMapKeyPtr()
  629. if err != nil {
  630. return
  631. }
  632. switch msgp.UnsafeString(field) {
  633. case "iv":
  634. var zobc uint32
  635. zobc, err = dc.ReadArrayHeader()
  636. if err != nil {
  637. return
  638. }
  639. if cap(z.iv) >= int(zobc) {
  640. z.iv = (z.iv)[:zobc]
  641. } else {
  642. z.iv = make([]interval16, zobc)
  643. }
  644. for zxpk := range z.iv {
  645. var zsnv uint32
  646. zsnv, err = dc.ReadMapHeader()
  647. if err != nil {
  648. return
  649. }
  650. for zsnv > 0 {
  651. zsnv--
  652. field, err = dc.ReadMapKeyPtr()
  653. if err != nil {
  654. return
  655. }
  656. switch msgp.UnsafeString(field) {
  657. case "start":
  658. z.iv[zxpk].start, err = dc.ReadUint16()
  659. if err != nil {
  660. return
  661. }
  662. case "last":
  663. z.iv[zxpk].length, err = dc.ReadUint16()
  664. z.iv[zxpk].length -= z.iv[zxpk].start
  665. if err != nil {
  666. return
  667. }
  668. default:
  669. err = dc.Skip()
  670. if err != nil {
  671. return
  672. }
  673. }
  674. }
  675. }
  676. case "card":
  677. z.card, err = dc.ReadInt64()
  678. if err != nil {
  679. return
  680. }
  681. default:
  682. err = dc.Skip()
  683. if err != nil {
  684. return
  685. }
  686. }
  687. }
  688. return
  689. }
  690. // EncodeMsg implements msgp.Encodable
  691. func (z *runContainer16) EncodeMsg(en *msgp.Writer) (err error) {
  692. // map header, size 2
  693. // write "iv"
  694. err = en.Append(0x82, 0xa2, 0x69, 0x76)
  695. if err != nil {
  696. return err
  697. }
  698. err = en.WriteArrayHeader(uint32(len(z.iv)))
  699. if err != nil {
  700. return
  701. }
  702. for zxpk := range z.iv {
  703. // map header, size 2
  704. // write "start"
  705. err = en.Append(0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  706. if err != nil {
  707. return err
  708. }
  709. err = en.WriteUint16(z.iv[zxpk].start)
  710. if err != nil {
  711. return
  712. }
  713. // write "last"
  714. err = en.Append(0xa4, 0x6c, 0x61, 0x73, 0x74)
  715. if err != nil {
  716. return err
  717. }
  718. err = en.WriteUint16(z.iv[zxpk].last())
  719. if err != nil {
  720. return
  721. }
  722. }
  723. // write "card"
  724. err = en.Append(0xa4, 0x63, 0x61, 0x72, 0x64)
  725. if err != nil {
  726. return err
  727. }
  728. err = en.WriteInt64(z.card)
  729. if err != nil {
  730. return
  731. }
  732. return
  733. }
  734. // MarshalMsg implements msgp.Marshaler
  735. func (z *runContainer16) MarshalMsg(b []byte) (o []byte, err error) {
  736. o = msgp.Require(b, z.Msgsize())
  737. // map header, size 2
  738. // string "iv"
  739. o = append(o, 0x82, 0xa2, 0x69, 0x76)
  740. o = msgp.AppendArrayHeader(o, uint32(len(z.iv)))
  741. for zxpk := range z.iv {
  742. // map header, size 2
  743. // string "start"
  744. o = append(o, 0x82, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74)
  745. o = msgp.AppendUint16(o, z.iv[zxpk].start)
  746. // string "last"
  747. o = append(o, 0xa4, 0x6c, 0x61, 0x73, 0x74)
  748. o = msgp.AppendUint16(o, z.iv[zxpk].last())
  749. }
  750. // string "card"
  751. o = append(o, 0xa4, 0x63, 0x61, 0x72, 0x64)
  752. o = msgp.AppendInt64(o, z.card)
  753. return
  754. }
  755. // UnmarshalMsg implements msgp.Unmarshaler
  756. func (z *runContainer16) UnmarshalMsg(bts []byte) (o []byte, err error) {
  757. var field []byte
  758. _ = field
  759. var zkgt uint32
  760. zkgt, bts, err = msgp.ReadMapHeaderBytes(bts)
  761. if err != nil {
  762. return
  763. }
  764. for zkgt > 0 {
  765. zkgt--
  766. field, bts, err = msgp.ReadMapKeyZC(bts)
  767. if err != nil {
  768. return
  769. }
  770. switch msgp.UnsafeString(field) {
  771. case "iv":
  772. var zema uint32
  773. zema, bts, err = msgp.ReadArrayHeaderBytes(bts)
  774. if err != nil {
  775. return
  776. }
  777. if cap(z.iv) >= int(zema) {
  778. z.iv = (z.iv)[:zema]
  779. } else {
  780. z.iv = make([]interval16, zema)
  781. }
  782. for zxpk := range z.iv {
  783. var zpez uint32
  784. zpez, bts, err = msgp.ReadMapHeaderBytes(bts)
  785. if err != nil {
  786. return
  787. }
  788. for zpez > 0 {
  789. zpez--
  790. field, bts, err = msgp.ReadMapKeyZC(bts)
  791. if err != nil {
  792. return
  793. }
  794. switch msgp.UnsafeString(field) {
  795. case "start":
  796. z.iv[zxpk].start, bts, err = msgp.ReadUint16Bytes(bts)
  797. if err != nil {
  798. return
  799. }
  800. case "last":
  801. z.iv[zxpk].length, bts, err = msgp.ReadUint16Bytes(bts)
  802. z.iv[zxpk].length -= z.iv[zxpk].start
  803. if err != nil {
  804. return
  805. }
  806. default:
  807. bts, err = msgp.Skip(bts)
  808. if err != nil {
  809. return
  810. }
  811. }
  812. }
  813. }
  814. case "card":
  815. z.card, bts, err = msgp.ReadInt64Bytes(bts)
  816. if err != nil {
  817. return
  818. }
  819. default:
  820. bts, err = msgp.Skip(bts)
  821. if err != nil {
  822. return
  823. }
  824. }
  825. }
  826. o = bts
  827. return
  828. }
  829. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  830. func (z *runContainer16) Msgsize() (s int) {
  831. s = 1 + 3 + msgp.ArrayHeaderSize + (len(z.iv) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 5 + msgp.Int64Size
  832. return
  833. }
  834. // DecodeMsg implements msgp.Decodable
  835. func (z *runIterator16) DecodeMsg(dc *msgp.Reader) (err error) {
  836. var field []byte
  837. _ = field
  838. var zqke uint32
  839. zqke, err = dc.ReadMapHeader()
  840. if err != nil {
  841. return
  842. }
  843. for zqke > 0 {
  844. zqke--
  845. field, err = dc.ReadMapKeyPtr()
  846. if err != nil {
  847. return
  848. }
  849. switch msgp.UnsafeString(field) {
  850. case "rc":
  851. if dc.IsNil() {
  852. err = dc.ReadNil()
  853. if err != nil {
  854. return
  855. }
  856. z.rc = nil
  857. } else {
  858. if z.rc == nil {
  859. z.rc = new(runContainer16)
  860. }
  861. err = z.rc.DecodeMsg(dc)
  862. if err != nil {
  863. return
  864. }
  865. }
  866. case "curIndex":
  867. z.curIndex, err = dc.ReadInt64()
  868. if err != nil {
  869. return
  870. }
  871. case "curPosInIndex":
  872. z.curPosInIndex, err = dc.ReadUint16()
  873. if err != nil {
  874. return
  875. }
  876. case "curSeq":
  877. z.curSeq, err = dc.ReadInt64()
  878. if err != nil {
  879. return
  880. }
  881. default:
  882. err = dc.Skip()
  883. if err != nil {
  884. return
  885. }
  886. }
  887. }
  888. return
  889. }
  890. // EncodeMsg implements msgp.Encodable
  891. func (z *runIterator16) EncodeMsg(en *msgp.Writer) (err error) {
  892. // map header, size 4
  893. // write "rc"
  894. err = en.Append(0x84, 0xa2, 0x72, 0x63)
  895. if err != nil {
  896. return err
  897. }
  898. if z.rc == nil {
  899. err = en.WriteNil()
  900. if err != nil {
  901. return
  902. }
  903. } else {
  904. err = z.rc.EncodeMsg(en)
  905. if err != nil {
  906. return
  907. }
  908. }
  909. // write "curIndex"
  910. err = en.Append(0xa8, 0x63, 0x75, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78)
  911. if err != nil {
  912. return err
  913. }
  914. err = en.WriteInt64(z.curIndex)
  915. if err != nil {
  916. return
  917. }
  918. // write "curPosInIndex"
  919. err = en.Append(0xad, 0x63, 0x75, 0x72, 0x50, 0x6f, 0x73, 0x49, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78)
  920. if err != nil {
  921. return err
  922. }
  923. err = en.WriteUint16(z.curPosInIndex)
  924. if err != nil {
  925. return
  926. }
  927. // write "curSeq"
  928. err = en.Append(0xa6, 0x63, 0x75, 0x72, 0x53, 0x65, 0x71)
  929. if err != nil {
  930. return err
  931. }
  932. err = en.WriteInt64(z.curSeq)
  933. if err != nil {
  934. return
  935. }
  936. return
  937. }
  938. // MarshalMsg implements msgp.Marshaler
  939. func (z *runIterator16) MarshalMsg(b []byte) (o []byte, err error) {
  940. o = msgp.Require(b, z.Msgsize())
  941. // map header, size 4
  942. // string "rc"
  943. o = append(o, 0x84, 0xa2, 0x72, 0x63)
  944. if z.rc == nil {
  945. o = msgp.AppendNil(o)
  946. } else {
  947. o, err = z.rc.MarshalMsg(o)
  948. if err != nil {
  949. return
  950. }
  951. }
  952. // string "curIndex"
  953. o = append(o, 0xa8, 0x63, 0x75, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78)
  954. o = msgp.AppendInt64(o, z.curIndex)
  955. // string "curPosInIndex"
  956. o = append(o, 0xad, 0x63, 0x75, 0x72, 0x50, 0x6f, 0x73, 0x49, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78)
  957. o = msgp.AppendUint16(o, z.curPosInIndex)
  958. // string "curSeq"
  959. o = append(o, 0xa6, 0x63, 0x75, 0x72, 0x53, 0x65, 0x71)
  960. o = msgp.AppendInt64(o, z.curSeq)
  961. return
  962. }
  963. // UnmarshalMsg implements msgp.Unmarshaler
  964. func (z *runIterator16) UnmarshalMsg(bts []byte) (o []byte, err error) {
  965. var field []byte
  966. _ = field
  967. var zqyh uint32
  968. zqyh, bts, err = msgp.ReadMapHeaderBytes(bts)
  969. if err != nil {
  970. return
  971. }
  972. for zqyh > 0 {
  973. zqyh--
  974. field, bts, err = msgp.ReadMapKeyZC(bts)
  975. if err != nil {
  976. return
  977. }
  978. switch msgp.UnsafeString(field) {
  979. case "rc":
  980. if msgp.IsNil(bts) {
  981. bts, err = msgp.ReadNilBytes(bts)
  982. if err != nil {
  983. return
  984. }
  985. z.rc = nil
  986. } else {
  987. if z.rc == nil {
  988. z.rc = new(runContainer16)
  989. }
  990. bts, err = z.rc.UnmarshalMsg(bts)
  991. if err != nil {
  992. return
  993. }
  994. }
  995. case "curIndex":
  996. z.curIndex, bts, err = msgp.ReadInt64Bytes(bts)
  997. if err != nil {
  998. return
  999. }
  1000. case "curPosInIndex":
  1001. z.curPosInIndex, bts, err = msgp.ReadUint16Bytes(bts)
  1002. if err != nil {
  1003. return
  1004. }
  1005. case "curSeq":
  1006. z.curSeq, bts, err = msgp.ReadInt64Bytes(bts)
  1007. if err != nil {
  1008. return
  1009. }
  1010. default:
  1011. bts, err = msgp.Skip(bts)
  1012. if err != nil {
  1013. return
  1014. }
  1015. }
  1016. }
  1017. o = bts
  1018. return
  1019. }
  1020. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  1021. func (z *runIterator16) Msgsize() (s int) {
  1022. s = 1 + 3
  1023. if z.rc == nil {
  1024. s += msgp.NilSize
  1025. } else {
  1026. s += z.rc.Msgsize()
  1027. }
  1028. s += 9 + msgp.Int64Size + 14 + msgp.Uint16Size + 7 + msgp.Int64Size
  1029. return
  1030. }
  1031. // DecodeMsg implements msgp.Decodable
  1032. func (z *uint16Slice) DecodeMsg(dc *msgp.Reader) (err error) {
  1033. var zjpj uint32
  1034. zjpj, err = dc.ReadArrayHeader()
  1035. if err != nil {
  1036. return
  1037. }
  1038. if cap((*z)) >= int(zjpj) {
  1039. (*z) = (*z)[:zjpj]
  1040. } else {
  1041. (*z) = make(uint16Slice, zjpj)
  1042. }
  1043. for zywj := range *z {
  1044. (*z)[zywj], err = dc.ReadUint16()
  1045. if err != nil {
  1046. return
  1047. }
  1048. }
  1049. return
  1050. }
  1051. // EncodeMsg implements msgp.Encodable
  1052. func (z uint16Slice) EncodeMsg(en *msgp.Writer) (err error) {
  1053. err = en.WriteArrayHeader(uint32(len(z)))
  1054. if err != nil {
  1055. return
  1056. }
  1057. for zzpf := range z {
  1058. err = en.WriteUint16(z[zzpf])
  1059. if err != nil {
  1060. return
  1061. }
  1062. }
  1063. return
  1064. }
  1065. // MarshalMsg implements msgp.Marshaler
  1066. func (z uint16Slice) MarshalMsg(b []byte) (o []byte, err error) {
  1067. o = msgp.Require(b, z.Msgsize())
  1068. o = msgp.AppendArrayHeader(o, uint32(len(z)))
  1069. for zzpf := range z {
  1070. o = msgp.AppendUint16(o, z[zzpf])
  1071. }
  1072. return
  1073. }
  1074. // UnmarshalMsg implements msgp.Unmarshaler
  1075. func (z *uint16Slice) UnmarshalMsg(bts []byte) (o []byte, err error) {
  1076. var zgmo uint32
  1077. zgmo, bts, err = msgp.ReadArrayHeaderBytes(bts)
  1078. if err != nil {
  1079. return
  1080. }
  1081. if cap((*z)) >= int(zgmo) {
  1082. (*z) = (*z)[:zgmo]
  1083. } else {
  1084. (*z) = make(uint16Slice, zgmo)
  1085. }
  1086. for zrfe := range *z {
  1087. (*z)[zrfe], bts, err = msgp.ReadUint16Bytes(bts)
  1088. if err != nil {
  1089. return
  1090. }
  1091. }
  1092. o = bts
  1093. return
  1094. }
  1095. // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
  1096. func (z uint16Slice) Msgsize() (s int) {
  1097. s = msgp.ArrayHeaderSize + (len(z) * (msgp.Uint16Size))
  1098. return
  1099. }
上海开阖软件有限公司 沪ICP备12045867号-1