Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tiny bug #383

Closed
wants to merge 2 commits into from
Closed

Fix tiny bug #383

wants to merge 2 commits into from

Conversation

Juke34
Copy link
Contributor

@Juke34 Juke34 commented Jul 6, 2023

seq_id replaced by SEQ when the name is 0 because perl see 0 as FALSE

BUG reported here: NBISweden/AGAT#368

@carandraug
Copy link
Member

Since we know we're dealing with a string, can we just evaluate it's length instead?

@Juke34
Copy link
Contributor Author

Juke34 commented Jul 12, 2023

You mean replacing

$name = 'SEQ' if (! $name and $name ne "0");

by

$name = 'SEQ' if ! length($name);

?

@carandraug
Copy link
Member

Yes. I think it's shorter and clearer. $name is a string and we only use SEQ when the string is empty. It's nice when we can just evaluate the truthiness of the variable, but we're already not doing that because we need to check for the specific "0" case. At that point, the whole abstraction is gone, so we might as well just check the string length.

carandraug pushed a commit that referenced this pull request Jul 12, 2023
When the sequence name is missing, we use the string "SEQ".  We were
evaluating the truthiness of the string value which evaluates as false
when the string is "0".

This commit replace the check with the string length.
@carandraug
Copy link
Member

Thank you for the fix. I squashed your two commits and remove the trailing whitespace before merging by fast forward. Because of the change for trailing whitespace, github does not recognize as it being merged (but it is). Closing as fixed. Thank you again.

@carandraug carandraug closed this Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants