mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix some project warnings + other fixes
- Prefer checking `.isEmpty` rather than `.count == 0` for Swift collections (can be more optimal) - Avoid comparing `BOOL` explicitly to `NO` (considered bad practice since `BOOL` is a `signed char`) - Specify unused `SGX_FLAGS` as `__unused` to silence warnings
This commit is contained in:
parent
a0b8016bcc
commit
6dc74ddcaf
|
@ -328,7 +328,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
|
||||||
|
|
||||||
open func updateSearchResults(searchText: String) {
|
open func updateSearchResults(searchText: String) {
|
||||||
let predicate: NSPredicate
|
let predicate: NSPredicate
|
||||||
if searchText.count == 0 {
|
if searchText.isEmpty {
|
||||||
filteredSections = sections
|
filteredSections = sections
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -4013,7 +4013,7 @@ typedef enum : NSUInteger {
|
||||||
|
|
||||||
- (void)saveDraft
|
- (void)saveDraft
|
||||||
{
|
{
|
||||||
if (self.inputToolbar.hidden == NO) {
|
if (!self.inputToolbar.hidden) {
|
||||||
__block TSThread *thread = _thread;
|
__block TSThread *thread = _thread;
|
||||||
__block NSString *currentDraft = [self.inputToolbar messageText];
|
__block NSString *currentDraft = [self.inputToolbar messageText];
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
|
||||||
self.messageBubbleViewHeightLayoutConstraint = messageBubbleView.autoSetDimension(.height, toSize: 0)
|
self.messageBubbleViewHeightLayoutConstraint = messageBubbleView.autoSetDimension(.height, toSize: 0)
|
||||||
rows.append(row)
|
rows.append(row)
|
||||||
|
|
||||||
if rows.count == 0 {
|
if rows.isEmpty {
|
||||||
// Neither attachment nor body.
|
// Neither attachment nor body.
|
||||||
owsFail("\(self.logTag) Message has neither attachment nor body.")
|
owsFail("\(self.logTag) Message has neither attachment nor body.")
|
||||||
rows.append(valueRow(name: NSLocalizedString("MESSAGE_METADATA_VIEW_NO_ATTACHMENT_OR_BODY",
|
rows.append(valueRow(name: NSLocalizedString("MESSAGE_METADATA_VIEW_NO_ATTACHMENT_OR_BODY",
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class OWSAudioSession: NSObject {
|
||||||
return oldActivity
|
return oldActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
guard currentActivities.count == 0 else {
|
guard currentActivities.isEmpty else {
|
||||||
Logger.debug("\(logTag) not deactivating due to currentActivities: \(currentActivities)")
|
Logger.debug("\(logTag) not deactivating due to currentActivities: \(currentActivities)")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
static const long SGX_FLAGS_INITTED = 0x0000000000000001L;
|
static const long SGX_FLAGS_INITTED = 0x0000000000000001L;
|
||||||
static const long SGX_FLAGS_DEBUG = 0x0000000000000002L;
|
static const long SGX_FLAGS_DEBUG = 0x0000000000000002L;
|
||||||
static const long SGX_FLAGS_MODE64BIT = 0x0000000000000004L;
|
static const long SGX_FLAGS_MODE64BIT = 0x0000000000000004L;
|
||||||
static const long SGX_FLAGS_PROVISION_KEY = 0x0000000000000004L;
|
static const long __unused SGX_FLAGS_PROVISION_KEY = 0x0000000000000004L;
|
||||||
static const long SGX_FLAGS_EINITTOKEN_KEY = 0x0000000000000004L;
|
static const long __unused SGX_FLAGS_EINITTOKEN_KEY = 0x0000000000000004L;
|
||||||
static const long SGX_FLAGS_RESERVED = 0xFFFFFFFFFFFFFFC8L;
|
static const long SGX_FLAGS_RESERVED = 0xFFFFFFFFFFFFFFC8L;
|
||||||
static const long SGX_XFRM_LEGACY = 0x0000000000000003L;
|
static const long __unused SGX_XFRM_LEGACY = 0x0000000000000003L;
|
||||||
static const long SGX_XFRM_AVX = 0x0000000000000006L;
|
static const long __unused SGX_XFRM_AVX = 0x0000000000000006L;
|
||||||
static const long SGX_XFRM_RESERVED = 0xFFFFFFFFFFFFFFF8L;
|
static const long SGX_XFRM_RESERVED = 0xFFFFFFFFFFFFFFF8L;
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
Loading…
Reference in a new issue