Commit b03dac8
authored
fix: getPeers size check (#2408)
<!--
Please read and fill out this form before submitting your PR.
Please make sure you have reviewed our contributors guide before
submitting your
first PR.
NOTE: PR titles should follow semantic commits:
https://www.conventionalcommits.org/en/v1.0.0/
-->
## Overview
<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
Ex: Closes #<issue number>
-->
While trying to fix the testapp tutorial from the docs I stumbled upon
that issue.
By checking `[len(seeds) == 0]` before splitting, you avoid the common
pitfall where [`strings.Split("", ",")]` returns a slice of length 1
containing an empty string `[""]`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved handling of empty input when processing peer seeds, ensuring
more efficient and accurate results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 70fa52e commit b03dac8
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
| 385 | + | |
387 | 386 | | |
388 | 387 | | |
| 388 | + | |
| 389 | + | |
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
| |||
0 commit comments