Skip to content

Commit

Permalink
Merge pull request #160 from franklinsch/event-zero-memory
Browse files Browse the repository at this point in the history
Set event properties' memory size to 0
  • Loading branch information
franklinsch authored Apr 18, 2018
2 parents eda7005 + 1e16d13 commit 89ac403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AST/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public struct Environment {
return declaredStructs.contains(type) || declaredContracts.contains(type)
}


/// Whether a property is defined in a type.
public func isPropertyDefined(_ property: String, enclosingType: RawTypeIdentifier) -> Bool {
return types[enclosingType]!.properties.keys.contains(property)
Expand Down Expand Up @@ -237,6 +236,7 @@ public struct Environment {
/// The memory size of a type, in terms of number of memory slots it occupies.
public func size(of type: Type.RawType) -> Int {
switch type {
case .builtInType(.event): return 0 // Events do not use memory.
case .builtInType(_): return 1
case .fixedSizeArrayType(let rawType, let elementCount): return size(of: rawType) * elementCount
case .arrayType(_): return 1
Expand Down

0 comments on commit 89ac403

Please sign in to comment.