From e1980d889846320a7c80c03c42da52247039fa7e Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 1 Feb 2017 20:13:27 -0500 Subject: [PATCH] Comments --- .../org/elasticsearch/index/fielddata/ScriptDocValues.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java b/core/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java index ac6c6e4534ac2..a1e62979cae6e 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java @@ -234,7 +234,7 @@ void refreshArray() { return; } if (dates == null) { - // Uninitialized + // Happens for the document. We delay allocating dates so we can allocate it with a reasonable size. dates = new MutableDateTime[values.count()]; for (int i = 0; i < dates.length; i++) { dates[i] = new MutableDateTime(values.valueAt(i), DateTimeZone.UTC); @@ -242,7 +242,7 @@ void refreshArray() { return; } if (values.count() > dates.length) { - // Values too small + // Happens when we move to a new document and it has more dates than any documents before it. MutableDateTime[] backup = dates; dates = new MutableDateTime[values.count()]; System.arraycopy(backup, 0, dates, 0, backup.length);