Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and nivi-apple committed Apr 19, 2024
1 parent 45ff4a8 commit c71246f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/platform/Darwin/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ CHIP_ERROR StartSRPTimer(uint16_t timeoutInMSecs, ResolveContext * ctx)
// Check to see if a user default value exists for the SRP timeout. If it does, override the timeoutInMSecs with user default
// value. To override the timeout value, use ` defaults write org.csa-iot.matter.darwin SRPTimeoutInMSecsOverride
// <timeoutinMsecs>` See UserDefaults.mm for details.
timeoutInMSecs = GetUserDefaultDnssdSRPTimeoutInMSecs().value_or(timeoutInMSecs);
timeoutInMSecs = GetUserDefaultDnssdSRPTimeoutInMSecs().value_or(timeoutInMSecs);

VerifyOrReturnValue(ctx != nullptr, CHIP_ERROR_INCORRECT_STATE);
ChipLogProgress(Discovery, "Starting timer to wait for %d milliseconds for possible SRP resolve results for %s", timeoutInMSecs,
Expand Down
5 changes: 2 additions & 3 deletions src/platform/Darwin/UserDefaults.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#import <Foundation/Foundation.h>

#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/SafeInt.h>
#include <lib/support/logging/CHIPLogging.h>
#include <optional>

static NSString * const kUserDefaultDomain = @"org.csa-iot.matter.darwin";
Expand All @@ -31,8 +31,7 @@
{
NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kUserDefaultDomain];
NSInteger srpTimeoutValue = [defaults integerForKey:kSRPTimeoutInMsecsUserDefaultKey];
if (CanCastTo<uint16_t>(srpTimeoutValue))
{
if (CanCastTo<uint16_t>(srpTimeoutValue)) {
uint16_t timeoutinMsecs = static_cast<uint16_t>(srpTimeoutValue);
ChipLogProgress(Discovery, "Got a user default value for Dnssd SRP timeout - %d msecs", timeoutinMsecs);
return std::make_optional(timeoutinMsecs);
Expand Down

0 comments on commit c71246f

Please sign in to comment.