Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !227

Refactor the TC...NthExprs... functions

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michiel Verloop requested to merge refactor/TCnthExprs into develop May 09, 2023
  • Overview 4
  • Commits 4
  • Changes 2

All refactored functions have the exact same functionality but with better (updated) documentation and more readable code and concise code.

There is one exception, TCgetNthExprsExpr, which I made non-nullable because I consider its nullability to be of no use & the tests run fine.

Old documented behaviour:
If n > chain length, return NULL. Otherwise, return EXPRS_EXPR of the nth expression.
What it actually did:
If n == chain length, return NULL. If n > chain length, abort. Otherwise, return EXPRS_EXPR of the nth expression.
What it does now:
If n >= chain length, abort. Otherwise, return EXPRS_EXPR of the nth expression.

If we do have cases where what it actually did is what we want, then in my opinion we should have another function TCgetNthExprsExprOrNull for that. That function can then return NULL instead of aborting.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: refactor/TCnthExprs