Loading...
Loading...
Use when writing or editing code in an existing codebase — before adding comments, docstrings, try/catch blocks, validation, logging, or TODOs the surrounding file doesn't have, and before explaining your style choices in the reply.
npx skill4agent add immamdouhaboammar/get-fable fable-native-codefable-architecturefable-executefable-simplifyfable-reviewsource_difftarget_fileidiomatic_codeclean_diffclampWindowmax >= 0// clampWindow clamps start and end into the valid range [0, max] and
// normalizes inverted windows. Returns (start, start) when end < start.
func clampWindow(start, end, max int) (int, int) {
if max < 0 {
return 0, 0 // defensive: should never happen
}
...
}func clampWindow(start, end, max int) (int, int) {
if start < 0 {
start = 0
}
if end > max {
end = max
}
if end < start {
end = start
}
return start, end
}replace_file_content