text: public static long GetLastCommitGeneration(string[] files){if (files == null){return -1;}long max = -1;foreach (var file in files){if (file.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !file.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal)){long gen = GenerationFromSegmentsFileName(file);if (gen > max){max = gen;}}}return max;}