Skip to content

Commit 8ae62b4

Browse files
committed
very minor optimization
1 parent fca1bb1 commit 8ae62b4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

PushSharp.Apple/ApnsConnection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,8 @@ public static void SetSocketKeepAliveValues (Socket socket, int KeepAliveTime, i
463463

464464
uint dummy = 0; //lenth = 4
465465
byte[] inOptionValues = new byte[System.Runtime.InteropServices.Marshal.SizeOf (dummy) * 3]; //size = lenth * 3 = 12
466-
bool OnOff = true;
467466

468-
BitConverter.GetBytes ((uint)(OnOff ? 1 : 0)).CopyTo (inOptionValues, 0);
467+
BitConverter.GetBytes ((uint)1).CopyTo (inOptionValues, 0);
469468
BitConverter.GetBytes ((uint)KeepAliveTime).CopyTo (inOptionValues, System.Runtime.InteropServices.Marshal.SizeOf (dummy));
470469
BitConverter.GetBytes ((uint)KeepAliveInterval).CopyTo (inOptionValues, System.Runtime.InteropServices.Marshal.SizeOf (dummy) * 2);
471470
// of course there are other ways to marshal up this byte array, this is just one way

0 commit comments

Comments
 (0)