From e58ec2d039e7b087815ef3eabddd896e7529e5d4 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Wed, 6 Sep 2023 11:26:03 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 563163901 --- .../ios/vision/core/sources/MPPRunningMode.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h b/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h index a3b3ad705..728ef2f48 100644 --- a/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h +++ b/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h @@ -39,16 +39,16 @@ typedef NS_ENUM(NSUInteger, MPPRunningMode) { } NS_SWIFT_NAME(RunningMode); NS_INLINE NSString *MPPRunningModeDisplayName(MPPRunningMode runningMode) { - if (runningMode > MPPRunningModeLiveStream) { - return nil; + switch (runningMode) { + case MPPRunningModeImage: + return @"Image"; + case MPPRunningModeVideo: + return @"Video"; + case MPPRunningModeLiveStream: + return @"Live Stream"; + default: + return nil; } - - NSString *displayNameMap[MPPRunningModeLiveStream + 1] = { - [MPPRunningModeImage] = @"Image", - [MPPRunningModeVideo] = @"Video", - [MPPRunningModeLiveStream] = @"Live Stream"}; - - return displayNameMap[runningMode]; } NS_ASSUME_NONNULL_END