Details
-
Sub-task
-
Status: Closed
-
Could
-
Resolution: Fixed
-
None
-
None
-
Low
Description
Case:
The possibility of simplifying the code of the isStringInArray method in the OpenmrsUtil class.
Current state:
The retVal variable is created and assigned the value true if string is found. At the same time, the method continues to search, even though it has already found.
Solution:
Delete the retVal variable and add "return true" if the string is found and "return false" if the array ends because that means the string was not found.
Link to place in code:
https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/util/OpenmrsUtil.java#L182-L191