Skip to content

Commit

Permalink
eliminate desnecessary var
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif committed Feb 15, 2024
1 parent 013530a commit ae836a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/token/main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,9 @@ shared(msg) actor class ICRC1Canister(args : {tokenOwner : Principal}) = this {
private func findEligibleTokens(user: Principal) : Nat {
var totalTokens : Nat = 0;
let accountIdx : [Nat] = Iter.toArray(Iter.range(0, 50));
var address : Text = "";
for(i in accountIdx.vals()) {
for (i in accountIdx.vals()) {
let subaccount_array : [Nat8] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Nat8.fromNat(i)];
address := EAID.fromPrincipal(user, ?subaccount_array);
let address = EAID.fromPrincipal(user, ?subaccount_array);
totalTokens += Option.get(eligibleTokens.get(address), 0);
};
return totalTokens;
Expand Down

0 comments on commit ae836a0

Please sign in to comment.