Commit 4f65f91
committed
Optimize syscall_write() to avoid redundant checks and FILE* retrievals
There is redundant checking of map_at_end within a loop, along with
repetitive calls to map_iter_value() to retrieve the file pointer. This
results in unnecessary overhead.
Address the issue by optimizing the code to perform the map_at_end
check and retrieve the file pointer only once at the beginning.1 parent c469828 commit 4f65f91
1 file changed
+13
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
109 | 107 | | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
121 | 116 | | |
| 117 | + | |
122 | 118 | | |
123 | 119 | | |
124 | 120 | | |
| |||
0 commit comments