#90 ByteStreamer#append

Lezárt
megnyitva ekkor: 4 éve ranides által · 1 hozzászólás
ranides hozzászólt 4 éve

We could try to avoid allocating new array if there is enough space in current buffer.

Current "pending" fragment can be moved to the begin of the "array". New data could be copied after it.

In fact, it won't change almost anything except:

  • conditional allocation
  • storing additional field: "array_length" (which could be smaller than array.length)
We could try to avoid allocating new array if there is enough space in current buffer. Current "pending" fragment can be moved to the begin of the "array". New data could be copied after it. In fact, it won't change almost anything except: - conditional allocation - storing additional field: "array_length" (which could be smaller than array.length)
ranides hozzászólt 4 éve
Tulajdonos
this.array_size = pending + input.length;
byte[] appended = this.array_size > array.length ? new byte[alloc] : array;
``` this.array_size = pending + input.length; byte[] appended = this.array_size > array.length ? new byte[alloc] : array; ```
ranides lezárta ekkor: 3 éve
ranides hivatkozott erre a hibajegyre egy commit-ban ekkor: 3 éve
Jelentkezzen be hogy csatlakozhasson a beszélgetéshez.
Nincs mérföldkő
Nincs megbízott
1 Résztvevő
Töltés...
Mégse
Mentés
Még nincs tartalom.