Skip to content

Commit ab2118b

Browse files
committed
Drop comments as the code is now concise enough to be understood without.
1 parent 9c9a5d7 commit ab2118b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/storage/kv_storage/littlefs/kv_littlefs.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ KeyValueStorage::KeyValueStorage(::littlefs::Filesystem & filesystem)
7676
auto KeyValueStorage::get(const std::string_view key, const std::size_t size, void* const data) const
7777
-> std::variant<Error, std::size_t>
7878
{
79-
/* Open the file containing the registry value. */
8079
auto const rc_open = _filesystem.open(toFilename(key), ::littlefs::OpenFlag::RDONLY);
8180
if (const auto * const err = std::get_if<::littlefs::Error>(&rc_open))
8281
return toError(*err);
8382

8483
auto const file_hdl = std::get<::littlefs::FileHandle>(rc_open);
8584

86-
/* Read from the file. */
8785
auto const rc_read = _filesystem.read(file_hdl, data, size);
8886
if (const auto * const err = std::get_if<::littlefs::Error>(&rc_read))
8987
{
@@ -99,14 +97,12 @@ auto KeyValueStorage::get(const std::string_view key, const std::size_t size, vo
9997
auto KeyValueStorage::put(const std::string_view key, const std::size_t size, const void* const data)
10098
-> std::optional<Error>
10199
{
102-
/* Open the file containing the registry value. */
103100
auto const rc_open = _filesystem.open(toFilename(key), ::littlefs::OpenFlag::WRONLY | ::littlefs::OpenFlag::CREAT | ::littlefs::OpenFlag::TRUNC);
104101
if (const auto * const err = std::get_if<::littlefs::Error>(&rc_open))
105102
return toError(*err);
106103

107104
auto const file_hdl = std::get<::littlefs::FileHandle>(rc_open);
108105

109-
/* Write to the file. */
110106
auto const rc_write = _filesystem.write(file_hdl, data, size);
111107
if (const auto * const err = std::get_if<::littlefs::Error>(&rc_write))
112108
{

0 commit comments

Comments
 (0)