core: Kill Statement::query() method

It's a pointless wrapper on top of `step()` that introduce additional
memory allocation and deallocation.
This commit is contained in:
Pekka Enberg
2025-02-04 13:34:57 +02:00
parent fb0a560d76
commit 097e56c19f
2 changed files with 2 additions and 9 deletions

View File

@@ -59,9 +59,8 @@ fn bench(criterion: &mut Criterion) {
.unwrap();
let io = io.clone();
b.iter(|| {
let mut rows = stmt.query().unwrap();
loop {
match rows.step().unwrap() {
match stmt.step().unwrap() {
limbo_core::StepResult::Row(row) => {
black_box(row);
}
@@ -106,9 +105,8 @@ fn bench(criterion: &mut Criterion) {
let mut stmt = limbo_conn.prepare("SELECT 1").unwrap();
let io = io.clone();
b.iter(|| {
let mut rows = stmt.query().unwrap();
loop {
match rows.step().unwrap() {
match stmt.step().unwrap() {
limbo_core::StepResult::Row(row) => {
black_box(row);
}

View File

@@ -474,11 +474,6 @@ impl Statement {
}
}
pub fn query(&mut self) -> Result<Statement> {
let stmt = Statement::new(self.program.clone(), self.pager.clone());
Ok(stmt)
}
pub fn columns(&self) -> &[String] {
&self.program.columns
}