Skip to content

Fix group and aggregate selections (#1639) - #649

Open
abeverley wants to merge 3 commits into
devfrom
1639_aggregate_fixes
Open

Fix group and aggregate selections (#1639)#649
abeverley wants to merge 3 commits into
devfrom
1639_aggregate_fixes

Conversation

@abeverley

Copy link
Copy Markdown
Contributor

No description provided.

@pwlodarski-ctrlo pwlodarski-ctrlo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR reviewed - I believe it appears fine. There are many for loops involved, especially nested ones, so I'm slightly concerned about efficiency/performance. I'm assuming there's no other way?

Comment thread lib/GADS/RecordsJoin.pm
if $parent;
# It's optional to supply an aggregate operator, in which case the one
# configured in the stored field is used.
if (!$operator)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be an unless?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pawel, TMTOWTDI... Personally I prefer to only use unless when it is after a statement - I find that quite readable, whereas I find it less natural in a statement such as the one this comment is related to (i.e, if x then do this, vs. do this unless y). As to other opinions, Damian Conway's Perl Best Practices stipulates never to use unless, and unsurprisingly there is even a SO discussion about it: https://stackoverflow.com/questions/3048726/usage-of-if-versus-unless-for-perl-conditionals

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarifying! It does appear to be a heavily discussed topic within the community indeed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably similar to the discussion of tabs vs spaces, although it is a mystery to me why anyone uses tabs!

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