From 3e9edf7115b87cad90077b47d185b37a337a7a03 Mon Sep 17 00:00:00 2001 From: sjinzh <99076655+sjinzh@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:34:54 +0800 Subject: [PATCH] delete system info output in zig codes --- .../zig/chapter_computational_complexity/leetcode_two_sum.zig | 4 ---- .../zig/chapter_computational_complexity/space_complexity.zig | 4 ---- .../zig/chapter_computational_complexity/time_complexity.zig | 4 ---- .../worst_best_time_complexity.zig | 4 ---- 4 files changed, 16 deletions(-) diff --git a/codes/zig/chapter_computational_complexity/leetcode_two_sum.zig b/codes/zig/chapter_computational_complexity/leetcode_two_sum.zig index dc963b595..66b96f95e 100644 --- a/codes/zig/chapter_computational_complexity/leetcode_two_sum.zig +++ b/codes/zig/chapter_computational_complexity/leetcode_two_sum.zig @@ -44,10 +44,6 @@ const SolutionHashMap = struct { // Driver Code pub fn main() !void { - // 查看本地CPU架构和操作系统信息 - var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); - std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); - // ======= Test Case ======= var nums = [_]i32{ 2, 7, 11, 15 }; var target: i32 = 9; diff --git a/codes/zig/chapter_computational_complexity/space_complexity.zig b/codes/zig/chapter_computational_complexity/space_complexity.zig index 3fe81a706..9798821a5 100644 --- a/codes/zig/chapter_computational_complexity/space_complexity.zig +++ b/codes/zig/chapter_computational_complexity/space_complexity.zig @@ -102,10 +102,6 @@ fn buildTree(mem_allocator: std.mem.Allocator, n: i32) !?*inc.TreeNode(i32) { // Driver Code pub fn main() !void { - // 查看本地CPU架构和操作系统信息 - var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); - std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); - const n: i32 = 5; // 常数阶 constant(n); diff --git a/codes/zig/chapter_computational_complexity/time_complexity.zig b/codes/zig/chapter_computational_complexity/time_complexity.zig index 40f609459..047950052 100644 --- a/codes/zig/chapter_computational_complexity/time_complexity.zig +++ b/codes/zig/chapter_computational_complexity/time_complexity.zig @@ -141,10 +141,6 @@ fn factorialRecur(n: i32) i32 { // Driver Code pub fn main() !void { - // 查看本地CPU架构和操作系统信息 - var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); - std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); - // 可以修改 n 运行,体会一下各种复杂度的操作数量变化趋势 const n: i32 = 8; std.debug.print("输入数据大小 n = {}\n", .{n}); diff --git a/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig b/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig index f9fcd2f67..0cdd61ebc 100644 --- a/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig +++ b/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig @@ -28,10 +28,6 @@ pub fn findOne(nums: []i32) i32 { // Driver Code pub fn main() !void { - // 查看本地CPU架构和操作系统信息 - var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); - std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); - var i: i32 = 0; while (i < 10) : (i += 1) { const n: usize = 100;