Skip to content

Commit c08b587

Browse files
author
Gary Gregory
committed
Simplify.
1 parent 91bd06a commit c08b587

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ private static Pattern compile(final String pattern, final int flags) {
9191
* @return Pattern compilation flags.
9292
*/
9393
private static int toFlags(final IOCase caseSensitivity) {
94-
int flags = 0;
95-
if (caseSensitivity != null && !caseSensitivity.isCaseSensitive()) {
96-
flags = Pattern.CASE_INSENSITIVE;
97-
}
98-
return flags;
94+
return caseSensitivity != null && !caseSensitivity.isCaseSensitive() ? Pattern.CASE_INSENSITIVE : 0;
9995
}
10096

10197
/** The regular expression pattern that will be used to match file names. */

0 commit comments

Comments
 (0)