aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-20 21:06:14 +0200
committerSven Göthel <[email protected]>2024-05-20 21:06:14 +0200
commitc1cb44f2a5668668f289c86de8ebb3f5bb574f32 (patch)
tree1ab34a4dce6bbb43be811d31e71a1a6385c815af /src
parente4f66034a4ab4504bcce158fed69aa7b1b55a614 (diff)
SMPKeyBin: Use string starts_with()
Diffstat (limited to 'src')
-rw-r--r--src/direct_bt/SMPKeyBin.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/direct_bt/SMPKeyBin.cpp b/src/direct_bt/SMPKeyBin.cpp
index 065dc397..30c19e5c 100644
--- a/src/direct_bt/SMPKeyBin.cpp
+++ b/src/direct_bt/SMPKeyBin.cpp
@@ -25,7 +25,6 @@
#include <cstring>
#include <limits>
#include <string>
-#include <memory>
#include <cstdint>
#include <cstdio>
#include <fstream>
@@ -45,7 +44,7 @@ static std::vector<std::string> get_file_list(const std::string& dname) {
const jau::fs::consume_dir_item cs = jau::bind_capref(&res,
( void(*)(std::vector<std::string>*, const jau::fs::dir_item&) ) /* help template type deduction of function-ptr */
( [](std::vector<std::string>* receiver, const jau::fs::dir_item& item) -> void {
- if( 0 == item.basename().find("bd_") ) { // prefix checl
+ if( item.basename().starts_with("bd_") ) { // prefix checl
const jau::nsize_t suffix_pos = item.basename().size() - 4;
if( suffix_pos == item.basename().find(".key", suffix_pos) ) { // suffix check
receiver->push_back( item.path() ); // full path