From 637c0455af2f3d3021b5c28a365250ac125b5ae2 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sun, 22 Jan 2017 15:07:11 +0100 Subject: Freeze default empty string for sql_type in get_oid_type One empty string allocation per column per row. --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 0ebd907cc0..735a26c436 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -438,7 +438,7 @@ module ActiveRecord end end - def get_oid_type(oid, fmod, column_name, sql_type = "") + def get_oid_type(oid, fmod, column_name, sql_type = "".freeze) if !type_map.key?(oid) load_additional_types(type_map, [oid]) end -- cgit v1.2.3