File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,14 @@ public final class Field {
17
17
18
18
public let cField : CField
19
19
20
- public var name : String {
21
- var name : String = " "
22
-
23
- let len = Int ( cField. name_length)
24
- cField. name. withMemoryRebound ( to: Byte . self, capacity: len) { pointer in
25
- let buff = UnsafeBufferPointer ( start: pointer, count: Int ( cField. name_length) )
26
- name = Array ( buff) . string
27
- }
28
-
29
- return name
30
- }
20
+ public let name : String
31
21
32
22
public init ( _ cField: CField ) {
33
23
self . cField = cField
24
+ let len = Int ( cField. name_length)
25
+ self . name = cField. name. withMemoryRebound ( to: Byte . self, capacity: len) { pointer in
26
+ let buff = UnsafeBufferPointer ( start: pointer, count: len)
27
+ return Array ( buff) . string
28
+ }
34
29
}
35
30
}
You can’t perform that action at this time.
0 commit comments