Created
August 16, 2019 21:23
-
-
Save ClysmiC/cd832f26e46be1ba337550ae50d5dc7d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class SecureTransactor | |
{ | |
public bool DoManySecureTransactions(string[] data) | |
{ | |
if (!SecurityCheck()) return false; | |
bool doCheck = false; // We already did the check, no need to repeat ourselves! | |
foreach(string datum in data) | |
{ | |
InternalDoSecureTranaction(data, doCheck); | |
} | |
} | |
public bool DoSecureTransaction(string data) | |
{ | |
bool doCheck = true; | |
return InternalDoSecureTransactions(data, doCheck); | |
} | |
protected bool InternalDoSecureTransaction(string data, bool doSecurityCheck=true) | |
{ | |
if (doSecurityChecks && !SecurityCheck()) | |
{ | |
return false; | |
} | |
// ... | |
return true; | |
} | |
protected bool SecurityCheck() | |
{ | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment