Uroš Bojanić created SPARK-59172:
------------------------------------

             Summary: Use isEmpty instead of size == 0 in core tests
                 Key: SPARK-59172
                 URL: https://issues.apache.org/jira/browse/SPARK-59172
             Project: Spark
          Issue Type: Improvement
          Components: Spark Core
    Affects Versions: 4.4.0
            Reporter: Uroš Bojanić


Several core test suites check collection emptiness with 'size == 0' instead of 
the more direct 'isEmpty'. This replaces 11 such occurrences across 6 test 
suites (MapOutputTrackerSuite, SparkTestSuite, 
StandaloneDynamicAllocationSuite, TaskSetManagerSuite, BlockManagerSuite, 
NextIteratorSuite) with 'isEmpty'. Behavior is unchanged. Note: two main-source 
occurrences (BlockManager, ShuffleBlockFetcherIterator) are intentionally left 
unchanged because there 'buf.size' is a ManagedBuffer byte count, not a 
collection size (ManagedBuffer has no isEmpty). Counterpart of SPARK-59149 (SQL 
modules); a separate PR covers MLlib.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to