Skip to content

Commit dd1d24e

Browse files
committed
chore: update
1 parent 067f466 commit dd1d24e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

provider/data_source_project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func getProjectMembersSchema(computed bool) *schema.Schema {
195195
},
196196
},
197197
Set: func(i interface{}) int {
198-
return internal.ToHashcodeString(conditionHash(i))
198+
return internal.ToHashcodeInt(conditionHash(i))
199199
},
200200
},
201201
},
@@ -284,7 +284,7 @@ func flattenMemberList(iamPolicy *v1pb.IamPolicy) ([]interface{}, error) {
284284
rawMember["member"] = member
285285
rawMember["role"] = binding.Role
286286
rawMember["condition"] = schema.NewSet(func(i interface{}) int {
287-
return internal.ToHashcodeString(conditionHash(i))
287+
return internal.ToHashcodeInt(conditionHash(i))
288288
}, []interface{}{rawCondition})
289289
memberList = append(memberList, rawMember)
290290
}
@@ -383,7 +383,7 @@ func memberHash(rawMember interface{}) int {
383383
_, _ = buf.WriteString(conditionHash(rawCondition))
384384
}
385385

386-
return internal.ToHashcodeString(buf.String())
386+
return internal.ToHashcodeInt(buf.String())
387387
}
388388

389389
func conditionHash(rawCondition interface{}) string {

provider/internal/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ func ValidateMemberBinding(member string) error {
177177
return nil
178178
}
179179

180-
func ToHashcodeString(s string) int {
180+
// ToHashcodeInt returns int by string.
181+
func ToHashcodeInt(s string) int {
181182
v := int(crc32.ChecksumIEEE([]byte(s)))
182183
if v >= 0 {
183184
return v

0 commit comments

Comments
 (0)