Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Jan 24, 2024
1 parent 2252536 commit 9c7e1f4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ios/AgoraRtcNg.mm
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,9 @@ - (void)dealloc {
void *handler[1] = {self.eventHandler};
if (bufferArray.count == 0) {
std::smatch output;
std::regex pattern = std::regex("^.*(Observer|Handler|Callback|Receiver|DirectCdnStreaming)$");
std::regex pattern = std::regex("^.*_.*((EventHandler|Observer|startDirectCdnStreaming|"
"Source|VideoFrameRenderer)(_[a-zA-Z0-9]*)?)$");
std::string name = funcName.UTF8String;
size_t first_ = name.find('_');
size_t second_ = name.find('_', first_ + 1);
if (first_ != std::string::npos && second_ != std::string::npos) {
name = name.substr(first_ + 1, second_ - first_ - 1);
}
if (std::regex_match(name, output, pattern)) {
param.buffer = handler;
param.buffer_count = 1;
Expand Down

0 comments on commit 9c7e1f4

Please sign in to comment.