Skip to main content
Commonmark migration
Source Link

##Purpose of sgl_detail_in_catch_bloc[]?##

Purpose of sgl_detail_in_catch_bloc[]?

It looks like the only use of sgl_detail_in_catch_bloc[] is in sgl_throw():

if (sgl_detail_in_catch_bloc[sgl_detail_exceptions_index])
{
    --sgl_detail_exceptions_index;
}

But that if statement should never be true because the only place that sets an array entry to true immediately decrements the index as well:

    sgl_detail_in_catch_bloc[sgl_detail_exceptions_index] = true;
    --sgl_detail_exceptions_index;

And the only place that can increment the index sets the array entry to false. In other words, I don't think that sgl_detail_in_catch_bloc[] currently serves any purpose, and all uses of it could be deleted without altering the behavior of your code.

##Purpose of sgl_detail_in_catch_bloc[]?##

It looks like the only use of sgl_detail_in_catch_bloc[] is in sgl_throw():

if (sgl_detail_in_catch_bloc[sgl_detail_exceptions_index])
{
    --sgl_detail_exceptions_index;
}

But that if statement should never be true because the only place that sets an array entry to true immediately decrements the index as well:

    sgl_detail_in_catch_bloc[sgl_detail_exceptions_index] = true;
    --sgl_detail_exceptions_index;

And the only place that can increment the index sets the array entry to false. In other words, I don't think that sgl_detail_in_catch_bloc[] currently serves any purpose, and all uses of it could be deleted without altering the behavior of your code.

Purpose of sgl_detail_in_catch_bloc[]?

It looks like the only use of sgl_detail_in_catch_bloc[] is in sgl_throw():

if (sgl_detail_in_catch_bloc[sgl_detail_exceptions_index])
{
    --sgl_detail_exceptions_index;
}

But that if statement should never be true because the only place that sets an array entry to true immediately decrements the index as well:

    sgl_detail_in_catch_bloc[sgl_detail_exceptions_index] = true;
    --sgl_detail_exceptions_index;

And the only place that can increment the index sets the array entry to false. In other words, I don't think that sgl_detail_in_catch_bloc[] currently serves any purpose, and all uses of it could be deleted without altering the behavior of your code.

Source Link
JS1
  • 28.9k
  • 3
  • 42
  • 83

##Purpose of sgl_detail_in_catch_bloc[]?##

It looks like the only use of sgl_detail_in_catch_bloc[] is in sgl_throw():

if (sgl_detail_in_catch_bloc[sgl_detail_exceptions_index])
{
    --sgl_detail_exceptions_index;
}

But that if statement should never be true because the only place that sets an array entry to true immediately decrements the index as well:

    sgl_detail_in_catch_bloc[sgl_detail_exceptions_index] = true;
    --sgl_detail_exceptions_index;

And the only place that can increment the index sets the array entry to false. In other words, I don't think that sgl_detail_in_catch_bloc[] currently serves any purpose, and all uses of it could be deleted without altering the behavior of your code.