Skip to content

Commit

Permalink
Refactor total count calculation in writeTuplesFromFile to directly u…
Browse files Browse the repository at this point in the history
…se the length of tuples
  • Loading branch information
Siddhant-K-code committed Jan 13, 2025
1 parent e2264f2 commit 28ba2d8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/tuple/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ func writeTuplesFromFile(flags *flag.FlagSet, fgaClient *client.OpenFgaClient) e
return err //nolint:wrapcheck
}

stats := ImportStats{
TotalTuples: len(tuples),
}

writeRequest := client.ClientWriteRequest{
Writes: tuples,
}
Expand All @@ -164,7 +160,7 @@ func writeTuplesFromFile(flags *flag.FlagSet, fgaClient *client.OpenFgaClient) e
outputResponse["failed"] = response.Failed
}

outputResponse["total_count"] = stats.TotalTuples
outputResponse["total_count"] = len(tuples)
outputResponse["successful_count"] = len(response.Successful)
outputResponse["failed_count"] = len(response.Failed)

Expand Down

0 comments on commit 28ba2d8

Please sign in to comment.