Skip to content

Instantly share code, notes, and snippets.

@chomado
Created October 2, 2014 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chomado/a2813aa17b24e5584aa9 to your computer and use it in GitHub Desktop.
Save chomado/a2813aa17b24e5584aa9 to your computer and use it in GitHub Desktop.
try は軽いが、throw されて catch するのは、割と重めのオペレーション
try
{
return KitKat のコード
}
catch (Exception) // SdkInt < KitKat の時に常に発生する例外
{
return KitKat 以前のコード
}
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