Created
October 2, 2014 06:13
-
-
Save chomado/a2813aa17b24e5584aa9 to your computer and use it in GitHub Desktop.
try は軽いが、throw されて catch するのは、割と重めのオペレーション
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
return KitKat のコード | |
} | |
catch (Exception) // SdkInt < KitKat の時に常に発生する例外 | |
{ | |
return KitKat 以前のコード | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (SdkInt >= KitKat) | |
{ | |
try | |
{ | |
return KitKat のコード | |
} | |
catch (Exception) // SdkInt < KitKat の時に常に発生する例外 | |
{ | |
// Fall through | |
} | |
} | |
return KitKat 以前のコード |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment