Skip to content

enh(MongoDB): Document::get returns value by const reference#4563

Merged
matejk merged 1 commit intomainfrom
mongodb-document-optimisation
May 23, 2024
Merged

enh(MongoDB): Document::get returns value by const reference#4563
matejk merged 1 commit intomainfrom
mongodb-document-optimisation

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented May 23, 2024

Performance optimisation to have the possibility to avoid copying when accessing MongoDB::Document's values.

Few other code improvements in MongoDB.

…of creating a copy and few other minor improvements.
@matejk matejk added this to the Release 1.14.0 milestone May 23, 2024
@matejk matejk self-assigned this May 23, 2024
Poco::DateTime birthDate(birthDateTimestamp);
assertTrue (birthDate.year() == 1969 && birthDate.month() == 3 && birthDate.day() == 9);
Poco::Timestamp lastupdatedTimestamp = doc->get<Poco::Timestamp>("lastupdated");
const auto& lastupdatedTimestamp = doc->get<Poco::Timestamp>("lastupdated");

Check notice

Code scanning / CodeQL

Unused local variable

Variable lastupdatedTimestamp is not used.
@matejk matejk merged commit cf1a299 into main May 23, 2024
@matejk matejk deleted the mongodb-document-optimisation branch May 23, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant