Skip to content

Conversation

@Paul-Licameli
Copy link

Results of some microscopic code review of SBFDSColumnData.h.

The one function I haven't yet reviewed to my satisfaction is FindClosestValueIndexForValue

@Paul-Licameli Paul-Licameli requested a review from a team as a code owner September 2, 2024 22:14
@Paul-Licameli Paul-Licameli marked this pull request as draft September 2, 2024 22:14
//try to insert the value if not already there
auto [inserted_id_entry, inserted] = stringIdValueEntries.emplace(string_id, nullptr);
if(inserted)
if(inserted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Style is for newline here

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there's logic in InsertFirstIndexIntoStringIdValueEntry to do the right thing, which mimics the logic above (line 658) for numbers.

static inline double GetMaxDifferenceTerm(const SBFDSColumnData &column,
GeneralizedDistanceEvaluator::FeatureAttributes &feature_attribs)
{
switch(feature_attribs.featureType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should this be static rather than a method of column data?

invalidIndices.insert(index);

if(internedNumberValues.valueInterningEnabled)
if(internedNumberValues.valueInterningEnabled || internedStringIdValues.valueInterningEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

Good find!

Copy link
Contributor

Choose a reason for hiding this comment

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

This one is important enough that I'm going to include it in another PR going in shortly to make the next release.

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