Skip to content

Commit

Permalink
Add int casting to use the modern boxing syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bleroux committed Sep 6, 2023
1 parent af17331 commit fae64e6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ static void ResizeChannelBuffer(NSObject<FlutterBinaryMessenger>* binaryMessenge
NSString* channel,
NSInteger newSize) {
NSCAssert(newSize >= 0, @"Channel buffer size must be non-negative");
NSArray* args = @[ channel, @(newSize) ];
// Cast newSize to int because the deserialization logic handles only 32 bits values,
// see
// https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L495.
NSArray* args = @[ channel, @((int)newSize) ];
FlutterMethodCall* resizeMethodCall = [FlutterMethodCall methodCallWithMethodName:kResizeMethod
arguments:args];
NSObject<FlutterMethodCodec>* codec = [FlutterStandardMethodCodec sharedInstance];
Expand Down

0 comments on commit fae64e6

Please sign in to comment.