Skip to content

Make unused constructor vars into vals - #26

Merged
barrybecker4 merged 1 commit into
masterfrom
cursor/constructor-val-params-9f60
Nov 8, 2026
Merged

barrybecker4 merged 1 commit into
masterfrom
cursor/constructor-val-params-9f60

Conversation

@barrybecker4

Copy link
Copy Markdown
Member

Constructor parameters that are never reassigned are now val instead of var:

  • FunctionInverter(functionMap)
  • ConjugateGradientSolver(matrix, b)

Getters remain public; only reference reassignment after construction is removed. Array contents for functionMap stay mutable as before.

No in-repo or downstream bb4 callers were found that assign to these fields. Making them private would hide the getters, so public val is the smaller API-safe change.

Fixes #19

Open in Web Open in Cursor 

FunctionInverter.functionMap and ConjugateGradientSolver.matrix/b were
public vars with no in-class or downstream reassignment callers. Public
vals keep getters and only remove setters.

Co-authored-by: Barry G Becker <barrybecker4@yahoo.com>
@barrybecker4
barrybecker4 merged commit e5dd1a9 into master Nov 8, 2026
1 check passed
@barrybecker4
barrybecker4 deleted the cursor/constructor-val-params-9f60 branch November 8, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace constructor var parameters with val where fields are not reassigned

2 participants