Closed Bug 1628713 Opened 5 years ago Closed 5 years ago

Add `Tokenizer::CheckPhrase` to quickly check for compound strings

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: mayhemer, Assigned: mayhemer)

References

Details

Attachments

(1 file)

mozilla::Tokenizer t("foo bar");
MOZ_ASSERT(t.CheckWord("foo "));

This will always fail the assertions because the tokenizer will read only "foo" from the input, so it can never match something with a trailing space.

Add a runtime check for not making this mistake and add a convenience function to allow such a check.

Blocks: 1629148
Summary: Add `Tokenizer::CheckString` to quickly check for compound strings → Add `Tokenizer::CheckPhrase` to quickly check for compound strings
Attachment #9139469 - Attachment description: Bug 1628713 - Add `Tokenizer::CheckString` to quickly check for compound strings, r=erahm → Bug 1628713 - Add `Tokenizer::CheckPhrase` to quickly check for compound strings, r=erahm
Pushed by honzab.moz@firemni.cz: https://hg.mozilla.org/integration/autoland/rev/1e65b41655c4 Add `Tokenizer::CheckPhrase` to quickly check for compound strings, r=xpcom-reviewers,erahm
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: