Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64172d3

Browse files
authored
fix: set preset parameters in the API rather than the frontend (#17403)
Follow-up from a [previous PullRequest](#16965) required someadditional testing of Presets from the API perspective.In the process of adding the new tests, I updated the API to enforcepreset parameter values based on the selected preset instead of trustingwhichever frontend makes the request. This avoids errors scenarios inprebuilds where a prebuild might expect a certain preset but find adifferent set of actual parameter values.
1 parentd78215c commit64172d3

File tree

4 files changed

+387
-46
lines changed

4 files changed

+387
-46
lines changed

‎coderd/util/slice/slice.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ func Contains[T comparable](haystack []T, needle T) bool {
6666
})
6767
}
6868

69+
funcCountMatchingPairs[A,Bany](a []A,b []B,matchfunc(A,B)bool)int {
70+
count:=0
71+
for_,a:=rangea {
72+
for_,b:=rangeb {
73+
ifmatch(a,b) {
74+
count++
75+
break
76+
}
77+
}
78+
}
79+
returncount
80+
}
81+
6982
// Find returns the first element that satisfies the condition.
7083
funcFind[Tany](haystack []T,condfunc(T)bool) (T,bool) {
7184
for_,hay:=rangehaystack {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp