CSV-115: Simplify boolean expressions in CSVRecord. This also closes #1 from github. Thanks to Furkan Kamaci.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1592822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a3260ed930
commit
85226d80e6
|
@ -136,7 +136,7 @@ public final class CSVRecord implements Serializable, Iterable<String> {
|
|||
* @return true of this record is valid, false if not
|
||||
*/
|
||||
public boolean isConsistent() {
|
||||
return mapping == null ? true : mapping.size() == values.length;
|
||||
return mapping == null || mapping.size() == values.length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,7 +147,7 @@ public final class CSVRecord implements Serializable, Iterable<String> {
|
|||
* @return whether a given column is mapped.
|
||||
*/
|
||||
public boolean isMapped(final String name) {
|
||||
return mapping != null ? mapping.containsKey(name) : false;
|
||||
return mapping != null && mapping.containsKey(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue