Skip to content

Some small optimizations #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 21, 2024
Merged

Some small optimizations #1424

merged 4 commits into from
Sep 21, 2024

Conversation

exrok
Copy link
Contributor

@exrok exrok commented Sep 12, 2024

Found these while working on improvements to reduce compile time performance and binary size.

Beyond efficiency, the previous impl might not add a space if the there
where duplicated options.
Also converted code to more idomatic removing an unwrap.

---
@exrok exrok force-pushed the small-optimizations branch from 046f321 to 112c537 Compare September 12, 2024 15:18
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement to me, thank you @exrok

write!(f, " AS")
} else {
Ok(())
match (*has_as, query) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is certainly good

@@ -10477,12 +10477,12 @@ impl<'a> Parser<'a> {
return parser_err!("Unsupported statement REPLACE", self.peek_token().location);
}

let insert = &mut self.parse_insert()?;
if let Statement::Insert(Insert { replace_into, .. }) = insert {
let mut insert = self.parse_insert()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10833787663

Details

  • 15 of 16 (93.75%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 89.337%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 7 8 87.5%
Totals Coverage Status
Change from base Build 10817360923: 0.008%
Covered Lines: 29424
Relevant Lines: 32936

💛 - Coveralls

@alamb alamb merged commit 2403f79 into apache:main Sep 21, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Sep 21, 2024

Thanks again @exrok

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.

3 participants