Commit 45564d1
committed
Cache split.splitId() result in a local variable to avoid calling the method twice per iteration:
- Clarity: Makes it explicit that both usages refer to the same value, improving readability.
- Consistency: Eliminates any theoretical risk if splitId() were ever changed to a non-pure method in the future.
- Minor efficiency: Avoids a redundant method dispatch on every iteration of the loop.1 parent d993c6a commit 45564d1
1 file changed
Lines changed: 3 additions & 2 deletions
File tree
- flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | | - | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| |||
0 commit comments