mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new BidiRun[0] happens too often. Introduce EMPTY_ARRAY
This commit is contained in:
@@ -266,7 +266,7 @@ abstract class LineLayout {
|
||||
assert startOffset <= endOffset;
|
||||
final BidiRun[] runs;
|
||||
if (startOffset == endOffset) {
|
||||
runs = new BidiRun[0];
|
||||
runs = BidiRun.EMPTY_ARRAY;
|
||||
}
|
||||
else {
|
||||
List<BidiRun> runList = new ArrayList<BidiRun>();
|
||||
@@ -338,7 +338,7 @@ abstract class LineLayout {
|
||||
}
|
||||
|
||||
private BidiRun[] createRuns() {
|
||||
if (myChunk == null) return new BidiRun[0];
|
||||
if (myChunk == null) return BidiRun.EMPTY_ARRAY;
|
||||
BidiRun run = new BidiRun(myChunk.endOffset);
|
||||
run.chunks = new Chunk[] {myChunk};
|
||||
return new BidiRun[] {run};
|
||||
@@ -474,6 +474,7 @@ abstract class LineLayout {
|
||||
}
|
||||
|
||||
private static class BidiRun {
|
||||
public static final BidiRun[] EMPTY_ARRAY = new BidiRun[0];
|
||||
private static final int CHUNK_CHARACTERS = 1024;
|
||||
|
||||
private final byte level;
|
||||
|
||||
Reference in New Issue
Block a user