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

[chef] Fix vector to array conversion logic. #28369

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/chef/common/chef-channel-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ void ChefChannelManager::HandleChangeChannel(CommandResponseHelper<ChangeChannel
{
matchedChannels[totalMatchedChannels++] = (channel);
}
else if (matchedChannels.size() == 0)
else if (totalMatchedChannels == 0)
{
// "index" is only used when we end up with matchedChannels.size() == 1.
// "index" is only used when we end up with totalMatchedChannels == 1.
// In that case, we want it to be the number of non-matching channels we saw before
// the matching one.
index++;
Expand All @@ -146,12 +146,12 @@ void ChefChannelManager::HandleChangeChannel(CommandResponseHelper<ChangeChannel
ChangeChannelResponseType response;

// Error: Found multiple matches
if (matchedChannels.size() > 1)
if (totalMatchedChannels > 1)
{
response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kMultipleMatches;
helper.Success(response);
}
else if (matchedChannels.size() == 0)
else if (totalMatchedChannels == 0)
{
// Error: Found no match
response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kNoMatches;
Expand Down
Loading