tirith icon indicating copy to clipboard operation
tirith copied to clipboard

Simplify Type Checking in sort_collections Function

Open AkashS0510 opened this issue 1 year ago • 5 comments

Issue: The current implementation of the sort_collections function in the utils.py manually checks for multiple data types (str, float, int, bool) using individual isinstance checks. This can be simplified by grouping these checks into a single isinstance statement, improving readability and reducing redundancy.

Task:

Update the sort_collections function in the utils.py to use a single isinstance check for primitive types.

AkashS0510 avatar Sep 28 '24 09:09 AkashS0510

done

gvsl60 avatar Sep 28 '24 16:09 gvsl60

@gabrilito1 There is another instance in the function where the simplification needs to be done. Can you check it and do that again?

AkashS0510 avatar Sep 30 '24 07:09 AkashS0510

yes, done

gvsl60 avatar Sep 30 '24 07:09 gvsl60

@AkashS0510 https://github.com/StackGuardian/tirith/pull/187

gvsl60 avatar Sep 30 '24 07:09 gvsl60

Thanks @gabrilito1

AkashS0510 avatar Sep 30 '24 13:09 AkashS0510