MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / resolveAt

Method resolveAt

native/desc/State.cpp:271–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269
270
271 ActivityStateActionPtr State::resolveAt(ActivityStateActionPtr action, time_t t) {
272 if (action->getTarget() == nullptr)
273 return action;
274 uintptr_t h = action->getTarget()->hash();
275 auto targetWidgets = this->_mergedWidgets.find(h);
276 if (targetWidgets == this->_mergedWidgets.end()) {
277 return action;
278 }
279 int total = (int) (this->_mergedWidgets.at(h).size());
280 int index = action->getVisitedCount() % total;
281 BLOG("resolve a merged widget %d/%d for action %s", index, total, action->getId().c_str());
282 action->setTarget(this->_mergedWidgets.at(h)[index]);
283 return action;
284 }
285
286 bool State::containsTarget(const WidgetPtr &widget) const {
287 for (const auto &w: this->_widgets) {

Callers 1

handleNullActionMethod · 0.80

Calls 8

getTargetMethod · 0.80
getVisitedCountMethod · 0.80
getIdMethod · 0.80
setTargetMethod · 0.80
hashMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected