satellite/uploadselection: avoid String conversation of location during node selection

Converting location to String is not free, better to avoid it.

81cb588c23/storj/location/countrycode.go (L32)

Thanks to Egon, who reported this issue.

See also: https://review.dev.storj.io/c/storj/common/+/10732

Change-Id: Ife348cffa59c020b46914a68be231c6eb75f06c9
This commit is contained in:
Márton Elek 2023-07-05 20:34:20 +02:00 committed by Storj Robot
parent 2c3464081f
commit 1525324384

View File

@ -34,7 +34,7 @@ func (c *Criteria) MatchInclude(node *SelectedNode) bool {
}
for _, code := range c.ExcludedCountryCodes {
if code.String() == "" {
if code == location.None {
continue
}
if node.CountryCode == code {