lib/google/cloud/debugger/snappoint.rb in google-cloud-debugger-0.41.0 vs lib/google/cloud/debugger/snappoint.rb in google-cloud-debugger-0.42.0
- old
+ new
@@ -31,15 +31,15 @@
# Max number of top stacks to collect local variables information
STACK_EVAL_DEPTH = 5
##
# Max size of payload a Snappoint collects
- MAX_PAYLOAD_SIZE = 32768 # 32KB
+ MAX_PAYLOAD_SIZE = 32_768 # 32KB
##
# @private Max size an evaluated expression variable is allowed to be
- MAX_EXPRESSION_LIMIT = 32768 # 32KB
+ MAX_EXPRESSION_LIMIT = 32_768 # 32KB
##
# @private Max size a normal evaluated variable is allowed to be
MAX_VAR_LIMIT = 1024 # 1KB
@@ -54,12 +54,11 @@
##
# @private Initialize the variable table by inserting a buffer full
# variable at index 0. This variable will be shared by other variable
# evaluations if this Snappoint exceeds size limit.
def init_var_table
- return if @variable_table[0] &&
- @variable_table[0].buffer_full_variable?
+ return if @variable_table[0]&.buffer_full_variable?
buffer_full_var = Variable.buffer_full_variable
@variable_table.variables.unshift buffer_full_var
end
@@ -177,14 +176,12 @@
result = stack_frame.locals.inject result do |sum, local|
sum + local.payload_size
end
end
- result = variable_table.variables.inject result do |sum, var|
+ variable_table.variables.inject result do |sum, var|
sum + var.payload_size
end
-
- result
end
##
# @private Translate a Ruby variable into a {Breakpoint::Variable}.
# If the existing evaluated variables already exceed maximum allowed