Closed Bug 1790572 Opened 2 years ago Closed 2 years ago

Minor code refactoring in nsMathMLOperators::LookupOperator(s)

Categories

(Core :: MathML, task)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: fredw, Assigned: fredw)

Details

Attachments

(1 file)

.

  • The operator form is an integer corresponding to the last two bits of
    nsOperatorFlags, so represent it as uint8_t when passed as a
    parameter of nsMathMLOperators::LookupOperator, as well as from the
    single caller nsMathMLmoFrame::ProcessTextData, to avoid confusion.
    This removes the use of NS_MATHML_OPERATOR_GET_FORM for casting.
    Note that the function already has an NS_ASSERTION to check the
    validity of the parameter.

  • Use modern for loop syntax to try the infix, postfix and prefix
    forms in nsMathMLOperators::LookupOperator/LookupOperators instead of
    duplicating code for each GetOperatorData call. Also make more
    explicit the subtle use of lazy evaluation to skip one
    GetOperatorData call from nsMathMLOperators::LookupOperator.

Summary: Minor code refactoring when handling operator forms → Minor code refactoring in nsMathMLOperators::LookupOperator(s)
Attachment #9294405 - Attachment description: WIP: Bug 1790572 - Minor code refactoring when handling operator forms → WIP: Bug 1790572 - Minor code refactoring in nsMathMLOperators::LookupOperator(s)
Attachment #9294405 - Attachment description: WIP: Bug 1790572 - Minor code refactoring in nsMathMLOperators::LookupOperator(s) → Bug 1790572 - Minor code refactoring in nsMathMLOperators::LookupOperator(s). r=emilio
Pushed by fred.wang@free.fr:
https://hg.mozilla.org/integration/autoland/rev/1dcb9b717ea3
Minor code refactoring in nsMathMLOperators::LookupOperator(s). r=emilio
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: