         }
         #if swift(>=3.0)
             if let rawData = rawData {
-        #endif
-        let data = NSData(bytes: rawData, length: rawDataLength)
-        return decoder(key, data)
-        #if swift(>=3.0)
+            let data = NSData(bytes: rawData, length: rawDataLength)
+            return decoder(key, data)
             } else {
             return nil
             }
+        #else
+            let data = NSData(bytes: rawData, length: rawDataLength)
+            return decoder(key, data)
         #endif
     }
     

            levelDBIteratorGetKey(iterator, &iKey, &iKeyLength);
            #if swift(>=3.0)
                if let iKey = iKey {
            #endif
            if let prefix = prefix {
                if memcmp(iKey, prefix.cString, min(prefix.length, iKeyLength)) != 0 {
                    break
                }
            }
            if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: stringEncoding) as? String {
                let getter : () -> NSObject? = {
                    #if swift(>=3.0)
                        var iData: UnsafeMutableRawPointer? = nil
                    #else
                        var iData: UnsafeMutableRawPointer = nil
                    #endif
                    var iDataLength: Int = 0
                    levelDBIteratorGetValue(iterator, &iData, &iDataLength);
                    #if swift(>=3.0)
                        if let iData = iData {
                    #endif
                    return self.decoder(iKeyString, NSData(bytes: iData, length: iDataLength));
                    #if swift(>=3.0)
                        } else {
                        return nil
                        }
                    #endif
                };
                block(iKeyString, getter, &stop);
            }
            #if swift(>=3.0)
                }
            #endif
            if (stop) {

        var rawDataLength: Int = 0
        let status = levelDBItemGet(db, key.cString, key.length, &rawData, &rawDataLength)
        if status == 0 {
            free(rawData)
            return true
        } else {
            return false
        }
