MCPcopy Create free account
hub / github.com/apache/fory / next

Method next

javascript/packages/core/lib/gen/map.ts:121–145  ·  view source on GitHub ↗
(keyInfo: ElementInfo, valueInfo: ElementInfo)

Source from the content-addressed store, hash-verified

119 }
120
121 next(keyInfo: ElementInfo, valueInfo: ElementInfo) {
122 if (keyInfo.isNull || valueInfo.isNull) {
123 this.endChunk();
124 this.header = this.writeHead(keyInfo, valueInfo, true);
125 this.preKeyInfo = keyInfo;
126 this.preValueInfo = valueInfo;
127 return this.header;
128 }
129 // max size of chunk is 255
130 if (
131 this.chunkSize == 255
132 || this.chunkOffset == 0
133 || !keyInfo.equalTo(this.preKeyInfo)
134 || !valueInfo.equalTo(this.preValueInfo)
135 ) {
136 // new chunk
137 this.endChunk();
138 this.chunkSize++;
139 this.preKeyInfo = keyInfo;
140 this.preValueInfo = valueInfo;
141 return (this.header = this.writeHead(keyInfo, valueInfo));
142 }
143 this.chunkSize++;
144 return this.header;
145 }
146
147 endChunk() {
148 if (this.chunkOffset > 0) {

Callers 15

writeMethod · 0.95
toListMethod · 0.45
compute_encodingMethod · 0.45
to_utf8Function · 0.45
only_field_typeFunction · 0.45
extract_generic_innerFunction · 0.45
unqualified_type_nameFunction · 0.45
get_type_id_by_nameFunction · 0.45

Calls 3

endChunkMethod · 0.95
writeHeadMethod · 0.95
equalToMethod · 0.45

Tested by 3

toListMethod · 0.36
only_field_typeFunction · 0.36