Skip to content

Commit b1c563d

Browse files
committed
Avoid use of std::function where possible
1 parent 7b617a9 commit b1c563d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/common/classes/array.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ class Array : public Storage
482482
return false;
483483
}
484484

485-
bool find(const std::function<int(const T& item)>& compare, size_type& pos) const
485+
template <typename F>
486+
bool findEx(F&& compare, size_type& pos) const
486487
{
487488
for (size_type i = 0; i < count; i++)
488489
{

src/jrd/Resources.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class Resources final
249249

250250
bool checkPresence(StoredElement* res, FB_SIZE_T& pos)
251251
{
252-
return this->find([res](const CachedResource<OBJ, PERM>& elem) {
252+
return this->findEx([res](const CachedResource<OBJ, PERM>& elem) {
253253
auto* e = elem();
254254
return e == res ? 0 : std::less<StoredElement*>{}(e, res) ? -1 : 1;
255255
}, pos);

src/jrd/intl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Collation* CharSetVers::getCollation(CollId id)
271271
Collation* CharSetVers::getCollation(const QualifiedName& name)
272272
{
273273
FB_SIZE_T pos;
274-
if (charset_collations.find([name](Collation* col) { return col->name == name; }, pos))
274+
if (charset_collations.findEx([name](Collation* col) { return col->name == name; }, pos))
275275
return charset_collations[pos]->validate();
276276

277277
ERR_post(Arg::Gds(isc_text_subtype) << name.toQuotedString());

0 commit comments

Comments
 (0)