Skip to content

Commit 4933162

Browse files
committed
remove pub keyword
1 parent d7388a5 commit 4933162

24 files changed

+25
-25
lines changed

math/abs.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn Abs(mut n: f64): f64 {
1+
fn Abs(mut n: f64): f64 {
22
if n < 0 {
33
n = -n
44
}

math/fact.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn Fact(n: f64): f64 {
1+
fn Fact(n: f64): f64 {
22
if n == 0 {
33
ret 1
44
}

math/fib.jule

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// O(2^n)
2-
pub fn Fib(i: int): int {
2+
fn Fib(i: int): int {
33
if i == 0 || i == 1 {
44
ret i
55
}
66
ret Fib(i - 1) + Fib(i - 2)
77
}
88

99
// O(n * 2^n)
10-
pub fn FibSeq(mut n: int): []int {
10+
fn FibSeq(mut n: int): []int {
1111
let mut s: []int
1212
let mut i = n
1313
for i > 0 {

math/max.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn Max(values: ...int): int {
1+
fn Max(values: ...int): int {
22
if values.len == 0 {
33
ret 0
44
}

math/median.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use sort::{QuickSort}
22

3-
pub fn Median(mut slice: []int): f64 {
3+
fn Median(mut slice: []int): f64 {
44
slice = QuickSort(slice)
55
let l = slice.len
66
match {

math/min.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn Min(values: ...int): int {
1+
fn Min(values: ...int): int {
22
if values.len == 0 {
33
ret 0
44
}

math/q_rsqrt.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use math for std::math
22

33
// Fast inverse square root.
44
// See: https://en.wikipedia.org/wiki/Fast_inverse_square_root
5-
pub fn QRsqrt(mut f: f64): f64 {
5+
fn QRsqrt(mut f: f64): f64 {
66
const ThreeHalfs = 1.5
77
const Magic = 0x5FE6EB50C7B537A9
88

math/sum.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn Sum(slice: []int): int {
1+
fn Sum(slice: []int): int {
22
let mut total: int = 0
33
for _, i in slice {
44
total += i

search/binary_search.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn BinarySearch(s: []int, i: int): (pos: int) {
1+
fn BinarySearch(s: []int, i: int): (pos: int) {
22
let mut b = 0
33
let mut e = s.len - 1
44
for b <= e {

search/linear_search.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn LinearSearch(s: []int, i: int): (pos: int) {
1+
fn LinearSearch(s: []int, i: int): (pos: int) {
22
for j, x in s {
33
if x == i {
44
ret j

sort/bubble_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn BubbleSort(mut s: []int): []int {
1+
fn BubbleSort(mut s: []int): []int {
22
let mut swapped = true
33
for swapped {
44
swapped = false

sort/exchange_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn ExchangeSort(mut s: []int): []int {
1+
fn ExchangeSort(mut s: []int): []int {
22
let mut i = 0
33
for i < s.len-1; i++ {
44
let mut j = i + 1

sort/insertion_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn InsertionSort(mut s: []int): []int {
1+
fn InsertionSort(mut s: []int): []int {
22
let mut currentIndex = 1
33
for currentIndex < s.len; currentIndex++ {
44
let temporary = s[currentIndex]

sort/quick_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn QuickSort(mut s: []int): []int {
1+
fn QuickSort(mut s: []int): []int {
22
if s.len <= 1 {
33
ret s
44
}

sort/selection_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn SelectionSort(mut s: []int): []int {
1+
fn SelectionSort(mut s: []int): []int {
22
let mut i = 0
33
for i < s.len; i++ {
44
let mut min = i

sort/shell_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn ShellSort(mut s: []int): []int {
1+
fn ShellSort(mut s: []int): []int {
22
let mut d = int(s.len / 2)
33
for d > 0; d /= 2 {
44
let mut i = d

sort/simple_sort.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub fn SimpleSort(mut s: []int): []int {
1+
fn SimpleSort(mut s: []int): []int {
22
let mut i = 1
33
for i < s.len; i++ {
44
let mut j = 0

string/atoi.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn isNbr(b: byte): bool {
2424
ret b >= '0' && b <= '9'
2525
}
2626

27-
pub fn Atoi(s: str): int {
27+
fn Atoi(s: str): int {
2828
let mut result = 0
2929
let mut sign = 1
3030
let mut i = 0

string/capitalize.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Capitalize("12345")
1313
"12345"
1414
*/
1515

16-
pub fn Capitalize(mut s: str): str {
16+
fn Capitalize(mut s: str): str {
1717
ret UpperCase((str)(s[0])) + LowerCase(s[1:])
1818
}

string/is_alpha.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ IsAlpha("Foo Bar")
1313
false
1414
*/
1515

16-
pub fn IsAlpha(s: str): bool {
16+
fn IsAlpha(s: str): bool {
1717
let mut state: bool = false
1818
for _, c in s {
1919
if c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' {

string/is_digit.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ IsDigit("123 45")
1313
false
1414
*/
1515

16-
pub fn IsDigit(digit: str): bool {
16+
fn IsDigit(digit: str): bool {
1717
let mut state: bool = false
1818
for _, n in digit {
1919
if n >= '0' && n <= '9' {

string/lower_case.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LowerCase("Foo 123")
1010
"foo 123"
1111
*/
1212

13-
pub fn LowerCase(mut s: str): str {
13+
fn LowerCase(mut s: str): str {
1414
for i, c in s {
1515
if c >= 'A' && c <= 'Z' {
1616
s[i] = 'z' - ('Z' - c)

string/reverse.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Reverse("FooBar")
77
"raBooF"
88
*/
99

10-
pub fn Reverse(mut s: str): str {
10+
fn Reverse(mut s: str): str {
1111
let mut i = 0
1212
for i < s.len/2; i++ {
1313
s[i], s[s.len-i-1] = s[s.len-i-1], s[i]

string/upper_case.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ upperCase("Foo 123")
1010
"FOO 123"
1111
*/
1212

13-
pub fn UpperCase(mut s: str): str {
13+
fn UpperCase(mut s: str): str {
1414
for i, c in s {
1515
if c >= 'a' && c <= 'z' {
1616
s[i] = 'Z' - ('z' - c)

0 commit comments

Comments
 (0)