Skip to content

Commit e0cbe59

Browse files
committed
Remove unnecessary function calls.
1 parent 8f94c03 commit e0cbe59

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

Source/SocketIO/Client/SocketIOClient.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
204204
leaveNamespace()
205205
}
206206

207-
/// Send an event to the server, with optional data items.
208-
///
209-
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
210-
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
211-
///
212-
/// - parameter event: The event to send.
213-
/// - parameter items: The items to send with this event. May be left out.
214-
open func emit(_ event: String, _ items: SocketData...) {
215-
do {
216-
try emit(event, with: items.map({ try $0.socketRepresentation() }))
217-
} catch {
218-
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
219-
type: logType)
220-
221-
handleClientEvent(.error, data: [event, items, error])
222-
}
223-
}
224-
225-
/// Send an event to the server, with optional data items and write completion handler.
207+
/// Send an event to the server, with optional data items and optional write completion handler.
226208
///
227209
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
228210
/// will be emitted. The structure of the error data is `[eventName, items, theError]`

Source/SocketIO/Client/SocketIOClientSpec.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,7 @@ public protocol SocketIOClientSpec : AnyObject {
9292
/// Disconnects the socket.
9393
func disconnect()
9494

95-
/// Send an event to the server, with optional data items.
96-
///
97-
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
98-
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
99-
///
100-
/// - parameter event: The event to send.
101-
/// - parameter items: The items to send with this event. May be left out.
102-
func emit(_ event: String, _ items: SocketData...)
103-
104-
/// Send an event to the server, with optional data items and write completion handler.
95+
/// Send an event to the server, with optional data items and optional write completion handler.
10596
///
10697
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
10798
/// will be emitted. The structure of the error data is `[eventName, items, theError]`

0 commit comments

Comments
 (0)