boolean (@NotNull DirEntry lastEntry, @NotNull String name, int prevIndex, int nameHash) { int[] childrenNameHashes = lastEntry.childrenNameHashes; // volatile read if (childrenNameHashes == null) { String[] list = (prevIndex != 0 ? new File(myRootDir, name.substring(0, prevIndex)) : myRootDir).list(); if (list != null) { childrenNameHashes = new int[list.length]; for (int i = 0; i < list.length; ++i) { childrenNameHashes[i] = StringUtilRt.stringHashCodeInsensitive(list[i], 0, list[i].length()); } } else { childrenNameHashes = DirEntry.empty; } lastEntry.childrenNameHashes = childrenNameHashes; // volatile write } for (int childNameHash : childrenNameHashes) { if (childNameHash == nameHash) { return true; } } return false; }