Skip to content

Rewrite containsPath() functions in PathUtils using Kotlin's firstOrNull() extension function.

Description

Rewrite the containsPath() extension functions in PathUtils to use Kotlin's firstOrNull() extension function instead of a for loop.

Motivation and Context

This change allows the containsPath() functions to be more concise, and in the case of the Array extension avoids the overhead of first converting the Array to a List.

How Has This Been Tested?

The tests included in the project could not be run, due to a compilation error about the ApplicationTestCase class being missing.

Screenshots / GIFs (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking change which cleans up / improves existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING section of the README document.

Merge request reports