MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / contains

Function contains

database/balance.go:39–46  ·  view source on GitHub ↗

Helper function to check if a slice contains a value.

(slice []string, val string)

Source from the content-addressed store, hash-verified

37
38// Helper function to check if a slice contains a value.
39func contains(slice []string, val string) bool {
40 for _, s := range slice {
41 if s == val {
42 return true
43 }
44 }
45 return false
46}
47
48// parseBigInt parses a string into a *big.Int, returning an error if parsing fails.
49// This ensures we don't silently get nil values when database returns malformed data.

Callers 7

prepareAccountQueriesFunction · 0.70
scanAccountRowFunction · 0.70
TestContains_FoundFunction · 0.70
TestContains_NotFoundFunction · 0.70
TestContains_EmptySliceFunction · 0.70
prepareQueriesFunction · 0.70
scanRowFunction · 0.70

Calls

no outgoing calls

Tested by 3

TestContains_FoundFunction · 0.56
TestContains_NotFoundFunction · 0.56
TestContains_EmptySliceFunction · 0.56