Commit 886c970
committed
refactor: two small pass-2 review cleanups
Pass 2 of code review on PR #732 found two more instances of patterns
pass 1 had just fixed elsewhere:
- internal/rules/tokenbudget/rule.go: Check() still inlined its own
copy of the TokensPerWord-fallback resolution that
effectiveTokensPerWord() (pass 1) was extracted specifically to
de-duplicate from tokenCount/modeLabel/definitelyUnderBudget — a
4th, un-consolidated copy. Now calls the shared helper too.
- pkg/markdown/flavor/detect.go: restoring lineStartOf's
negative-offset clamp (pass 1) copied the same clamp logic LineCol
already had a few lines below instead of sharing it. Extracted
clampOffset, used by both.1 parent 1e44952 commit 886c970
2 files changed
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 84 | + | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
| |||
149 | 145 | | |
150 | 146 | | |
151 | 147 | | |
152 | | - | |
153 | | - | |
| 148 | + | |
| 149 | + | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
341 | 349 | | |
342 | | - | |
| 350 | + | |
343 | 351 | | |
344 | 352 | | |
345 | | - | |
| 353 | + | |
346 | 354 | | |
347 | | - | |
| 355 | + | |
348 | 356 | | |
349 | 357 | | |
350 | 358 | | |
| |||
388 | 396 | | |
389 | 397 | | |
390 | 398 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
| 399 | + | |
397 | 400 | | |
398 | 401 | | |
399 | 402 | | |
| |||
0 commit comments