Mode: eliminate "self" naming convention

This commit is contained in:
Isaac Freund 2024-03-14 13:00:15 +01:00
parent b9dde3c49b
commit 3077074329
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const Self = @This();
const Mode = @This();
const std = @import("std");
const util = @import("util.zig");
@ -28,11 +28,11 @@ mappings: std.ArrayListUnmanaged(Mapping) = .{},
pointer_mappings: std.ArrayListUnmanaged(PointerMapping) = .{},
switch_mappings: std.ArrayListUnmanaged(SwitchMapping) = .{},
pub fn deinit(self: *Self) void {
util.gpa.free(self.name);
for (self.mappings.items) |m| m.deinit();
self.mappings.deinit(util.gpa);
for (self.pointer_mappings.items) |*m| m.deinit();
self.pointer_mappings.deinit(util.gpa);
self.switch_mappings.deinit(util.gpa);
pub fn deinit(mode: *Mode) void {
util.gpa.free(mode.name);
for (mode.mappings.items) |m| m.deinit();
mode.mappings.deinit(util.gpa);
for (mode.pointer_mappings.items) |*m| m.deinit();
mode.pointer_mappings.deinit(util.gpa);
mode.switch_mappings.deinit(util.gpa);
}