dsp: remove unused code, let the compiler decide about inlining
This commit is contained in:
parent
5d7266abbc
commit
2a84e3f299
@ -12,7 +12,6 @@ impl Accu {
|
|||||||
|
|
||||||
impl Iterator for Accu {
|
impl Iterator for Accu {
|
||||||
type Item = i32;
|
type Item = i32;
|
||||||
#[inline]
|
|
||||||
fn next(&mut self) -> Option<i32> {
|
fn next(&mut self) -> Option<i32> {
|
||||||
let s = self.state;
|
let s = self.state;
|
||||||
self.state = self.state.wrapping_add(self.step);
|
self.state = self.state.wrapping_add(self.step);
|
||||||
|
@ -14,7 +14,6 @@ impl Complex<i32> {
|
|||||||
/// Complex::<i32>::from_angle(1 << 30); // pi/2
|
/// Complex::<i32>::from_angle(1 << 30); // pi/2
|
||||||
/// Complex::<i32>::from_angle(-1 << 30); // -pi/2
|
/// Complex::<i32>::from_angle(-1 << 30); // -pi/2
|
||||||
/// ```
|
/// ```
|
||||||
#[inline(always)]
|
|
||||||
pub fn from_angle(angle: i32) -> Self {
|
pub fn from_angle(angle: i32) -> Self {
|
||||||
let (c, s) = cossin(angle);
|
let (c, s) = cossin(angle);
|
||||||
Self(c, s)
|
Self(c, s)
|
||||||
|
@ -3,38 +3,6 @@
|
|||||||
|
|
||||||
use core::ops::{Add, Mul, Neg};
|
use core::ops::{Add, Mul, Neg};
|
||||||
|
|
||||||
/// Bit shift, round up half.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
///
|
|
||||||
/// `x` - Value to shift and round.
|
|
||||||
/// `shift` - Number of bits to right shift `x`.
|
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
///
|
|
||||||
/// Shifted and rounded value.
|
|
||||||
#[inline(always)]
|
|
||||||
pub fn shift_round(x: i32, shift: usize) -> i32 {
|
|
||||||
(x + (1 << (shift - 1))) >> shift
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Integer division, round up half.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
///
|
|
||||||
/// `dividend` - Value to divide.
|
|
||||||
/// `divisor` - Value that divides the
|
|
||||||
/// dividend. `dividend`+`divisor`-1 must be inside [i64::MIN,
|
|
||||||
/// i64::MAX].
|
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
///
|
|
||||||
/// Divided and rounded value.
|
|
||||||
#[inline(always)]
|
|
||||||
pub fn divide_round(dividend: i64, divisor: i64) -> i64 {
|
|
||||||
(dividend + (divisor - 1)) / divisor
|
|
||||||
}
|
|
||||||
|
|
||||||
fn abs<T>(x: T) -> T
|
fn abs<T>(x: T) -> T
|
||||||
where
|
where
|
||||||
T: PartialOrd + Default + Neg<Output = T>,
|
T: PartialOrd + Default + Neg<Output = T>,
|
||||||
|
Loading…
Reference in New Issue
Block a user