Skip to content

Commit 8c49411

Browse files
committed
Fix useless call
1 parent 13f2431 commit 8c49411

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

benchmark/DriverBench/SingleDocBench.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function benchRunCommand(): void
4343
* @see https://github.com/mongodb/specifications/blob/ddfc8b583d49aaf8c4c19fa01255afb66b36b92e/source/benchmarking/benchmarking.rst#find-one-by-id
4444
* @param array{options: array} $params
4545
*/
46-
#[BeforeMethods('setupFindOneById')]
46+
#[BeforeMethods('beforeFindOneById')]
4747
#[ParamProviders('provideFindOneByIdParams')]
4848
#[Revs(1)]
4949
public function benchFindOneById(array $params): void
@@ -55,7 +55,7 @@ public function benchFindOneById(array $params): void
5555
}
5656
}
5757

58-
public function setupFindOneById(): void
58+
public function beforeFindOneById(): void
5959
{
6060
$tweet = Data::readJsonFile(Data::TWEET_FILE_PATH);
6161
$docs = array_map(fn ($id) => $tweet + ['_id' => $id], range(1, 10_000));
@@ -85,7 +85,7 @@ public function benchInsertOne(array $params): void
8585
$collection = Utils::getCollection();
8686

8787
for ($i = $params['repeat']; $i > 0; $i--) {
88-
$collection->insertOne($params['document'], $params['options'] ?? []);
88+
$collection->insertOne($params['document']);
8989
}
9090
}
9191

benchmark/Extension/EnvironmentProvider.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ public function isApplicable(): bool
2626

2727
public function getInformation(): Information
2828
{
29-
$client = Utils::getClient();
30-
$client->getManager()->selectServer();
29+
$manager = Utils::getClient()->getManager();
3130

3231
return new Information('mongodb', array_merge(
3332
$this->getUri(),
34-
$this->getServerInfo($client->getManager()),
35-
$this->getBuildInfo($client->getManager()),
33+
$this->getServerInfo($manager),
34+
$this->getBuildInfo($manager),
3635
));
3736
}
3837

0 commit comments

Comments
 (0)