(fj fastJsonNode)
| 849 | } |
| 850 | |
| 851 | func (enc *encoder) copyFastJsonList(fj fastJsonNode) (fastJsonNode, int) { |
| 852 | if fj == nil { |
| 853 | return fj, 0 |
| 854 | } |
| 855 | |
| 856 | var head, tail fastJsonNode |
| 857 | nodeCount := 0 |
| 858 | |
| 859 | for fj != nil { |
| 860 | nodeCount++ |
| 861 | nn := enc.copySingleNode(fj) |
| 862 | if tail == nil { |
| 863 | head, tail = nn, nn |
| 864 | fj = fj.next |
| 865 | continue |
| 866 | } |
| 867 | tail.next = nn |
| 868 | fj, tail = fj.next, tail.next |
| 869 | } |
| 870 | |
| 871 | return head, nodeCount |
| 872 | } |
| 873 | |
| 874 | func (enc *encoder) copySingleNode(fj fastJsonNode) fastJsonNode { |
| 875 | if fj == nil { |