Skip to content

Commit

Permalink
run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroBurner committed Jun 25, 2022
1 parent 4d85f7a commit f757c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/ble/NotificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NotificationManager::Notification NotificationManager::GetLastNotification() con
return this->At(0);
}

const NotificationManager::Notification &NotificationManager::At(NotificationManager::Notification::Idx idx) const {
const NotificationManager::Notification& NotificationManager::At(NotificationManager::Notification::Idx idx) const {
if (idx >= notifications.size()) {
assert(false);
return notifications.at(beginIdx); // this should not happen
Expand All @@ -42,7 +42,7 @@ const NotificationManager::Notification &NotificationManager::At(NotificationMan
return notifications.at(read_idx);
}

NotificationManager::Notification &NotificationManager::At(NotificationManager::Notification::Idx idx) {
NotificationManager::Notification& NotificationManager::At(NotificationManager::Notification::Idx idx) {
if (idx >= notifications.size()) {
assert(false);
return notifications.at(beginIdx); // this should not happen
Expand All @@ -57,7 +57,7 @@ NotificationManager::Notification NotificationManager::Get(NotificationManager::

NotificationManager::Notification::Idx NotificationManager::FindId(NotificationManager::Notification::Id id) const {
for (NotificationManager::Notification::Idx idx = 0; idx < this->size; idx++) {
const NotificationManager::Notification &notification = this->At(idx);
const NotificationManager::Notification& notification = this->At(idx);
if (notification.id == id) {
return idx;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ble/NotificationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ namespace Pinetime {
private:
Notification::Id nextId {0};
Notification::Id GetNextId();
const Notification &At(Notification::Idx idx) const;
Notification &At(Notification::Idx idx);
const Notification& At(Notification::Idx idx) const;
Notification& At(Notification::Idx idx);
static constexpr uint8_t TotalNbNotifications = 5;
std::array<Notification, TotalNbNotifications> notifications;
size_t beginIdx = TotalNbNotifications - 1; // index of the newest notification
Expand Down

0 comments on commit f757c94

Please sign in to comment.