Skip to content

Commit

Permalink
Don't do work in asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlawton committed Apr 4, 2016
1 parent ed6a586 commit 642110a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dupes/TemporaryFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ extension NSFileHandle {

// Fill buffer with a C string representing the local file system path.
var buffer = [Int8](count: Int(PATH_MAX), repeatedValue: 0)
assert(template.getFileSystemRepresentation(&buffer, maxLength: buffer.count))
let ok = template.getFileSystemRepresentation(&buffer, maxLength: buffer.count)
assert(ok, "Failed to get file system representation")

// Create unique file name (and open file):
let fd = mkstemps(&buffer, suffixLength)
Expand Down

0 comments on commit 642110a

Please sign in to comment.