Skip to content

check and optimize vec operation in acount-linker #34

@Satoshi-Kusumoto

Description

@Satoshi-Kusumoto
if (index >= addrs.len()) && (addrs.len() != MAX_ETH_LINKS) {
	addrs.push(addr.clone());
} else if (index >= addrs.len()) && (addrs.len() == MAX_ETH_LINKS) {
	addrs[MAX_ETH_LINKS - 1] = addr.clone();
} else {
	addrs[index] = addr.clone();
}

Currently we use the following code the insert a new address for eth (and also btc).
1 This may be extracted as a function
2 != is suspicious (also the whole logic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions