Skip to content

Commit faf9f5b

Browse files
andy31415andreilitvin
authored andcommitted
Fix array vs vector conversion in chef (#28369)
Co-authored-by: Andrei Litvin <[email protected]>
1 parent 98df282 commit faf9f5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/chef/common/chef-channel-manager.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ void ChefChannelManager::HandleChangeChannel(CommandResponseHelper<ChangeChannel
134134
{
135135
matchedChannels[totalMatchedChannels++] = (channel);
136136
}
137-
else if (matchedChannels.size() == 0)
137+
else if (totalMatchedChannels == 0)
138138
{
139-
// "index" is only used when we end up with matchedChannels.size() == 1.
139+
// "index" is only used when we end up with totalMatchedChannels == 1.
140140
// In that case, we want it to be the number of non-matching channels we saw before
141141
// the matching one.
142142
index++;
@@ -146,12 +146,12 @@ void ChefChannelManager::HandleChangeChannel(CommandResponseHelper<ChangeChannel
146146
ChangeChannelResponseType response;
147147

148148
// Error: Found multiple matches
149-
if (matchedChannels.size() > 1)
149+
if (totalMatchedChannels > 1)
150150
{
151151
response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kMultipleMatches;
152152
helper.Success(response);
153153
}
154-
else if (matchedChannels.size() == 0)
154+
else if (totalMatchedChannels == 0)
155155
{
156156
// Error: Found no match
157157
response.status = chip::app::Clusters::Channel::ChannelStatusEnum::kNoMatches;

0 commit comments

Comments
 (0)