Skip to content

Commit 796c446

Browse files
committed
Freeze all strings
1 parent 9bbc3fe commit 796c446

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+92
-22
lines changed

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
source 'https://rubygems.org'
2-
3-
# Specify your gem's dependencies in sassc.gemspec
1+
source "https://rubygems.org"
42
gemspec

lib/sassc.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
end
35

46
require_relative "sassc/version"
5-
require_relative "sassc/root"
67
require_relative "sassc/native"
78
require_relative "sassc/import_handler"
89
require_relative "sassc/importer"

lib/sassc/dependency.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
class Dependency
35
attr_reader :filename

lib/sassc/engine.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require_relative "error"
24

35
module SassC

lib/sassc/error.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "pathname"
24

35
module SassC

lib/sassc/functions_handler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
class FunctionsHandler
35
def initialize(options)

lib/sassc/import_handler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
class ImportHandler
35
def initialize(options)

lib/sassc/importer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
class Importer
35
attr_reader :options

lib/sassc/native.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "ffi"
24

35
module SassC
@@ -48,8 +50,7 @@ def self.return_string_array(ptr)
4850
end
4951

5052
def self.native_string(string)
51-
string = string.to_s
52-
string << "\0"
53+
string = "#{string}\0"
5354
data = Native::LibC.malloc(string.bytesize)
5455
data.write_string(string)
5556
data

lib/sassc/native/lib_c.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module SassC
24
module Native
35
module LibC

0 commit comments

Comments
 (0)