Commit ed2c65a
committed
fix(noreferencestyle): keep nil return on zero footnote matches
make([]footnoteOccurrence, 0, len(matches)) is non-nil even when
len(matches) == 0 (Go's make does not special-case a zero-capacity
slice back to nil), so the earlier pre-sizing commit silently broke
the "return nil, not []T{}" convention this same PR applies to
headingincrement and tableformat for the common zero-match case.
Return nil directly before the pre-sized make when there are no
matches. Caught by code review round 2.
Also corrects the extractHeadings doc/test comments in
requiredstructure: checkSingleFileSchemaFromData (single-source) and
checkComposedSources's per-source loop (N>=2 extends sources) are
mutually exclusive within one Check, so the walk count saved is N,
not "N+" as the round-1 correction still implied.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BTLNzEVChZtqSc7m7ph5Ah1 parent 11fe5e1 commit ed2c65a
4 files changed
Lines changed: 41 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
| |||
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1874 | 1874 | | |
1875 | 1875 | | |
1876 | 1876 | | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
1883 | 1886 | | |
1884 | 1887 | | |
1885 | 1888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2004 | 2004 | | |
2005 | 2005 | | |
2006 | 2006 | | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
2010 | | - | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
2011 | 2011 | | |
2012 | 2012 | | |
2013 | 2013 | | |
| |||
0 commit comments