mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Code Cleanup
- Upgraded the magic number 10 to a constant with dynamic debug warning.
This commit is contained in:
parent
66b39f6797
commit
4f98c8d9b5
1 changed files with 5 additions and 2 deletions
|
@ -114,6 +114,9 @@ static struct
|
|||
|
||||
//static const char* non_word_chars = " +-*/%()=<>!~";
|
||||
|
||||
// Alias expansion limit. Any more would indicate some kind of error.
|
||||
const int safetyValveDefault = 10;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A3::A3 ()
|
||||
: _read_only_command (true)
|
||||
|
@ -374,7 +377,7 @@ void A3::resolve_aliases ()
|
|||
{
|
||||
std::vector <std::string> expanded;
|
||||
bool something;
|
||||
int safety_valve = 10;
|
||||
int safety_valve = safetyValveDefault;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -423,7 +426,7 @@ void A3::resolve_aliases ()
|
|||
while (something && --safety_valve > 0);
|
||||
|
||||
if (safety_valve <= 0)
|
||||
context.debug ("Nested alias limit of 10 reached.");
|
||||
context.debug (format ("Nested alias limit of {1} reached.", safetyValveDefault));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue