From 7a0e0b8f338e8b758a7ed869fd9be86e011b6a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 30 Aug 2012 07:37:07 +0200 Subject: [PATCH] Simplify mode determination --- skimage/transform/_warps_cy.pyx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/skimage/transform/_warps_cy.pyx b/skimage/transform/_warps_cy.pyx index 5903380e..18b1a5b0 100644 --- a/skimage/transform/_warps_cy.pyx +++ b/skimage/transform/_warps_cy.pyx @@ -87,13 +87,7 @@ def _warp_fast(np.ndarray image, np.ndarray H, output_shape=None, int order=1, if mode not in ('constant', 'wrap', 'reflect'): raise ValueError("Invalid mode specified. Please use " "`constant`, `wrap` or `reflect`.") - cdef char mode_c - if mode == 'constant': - mode_c = ord('C') - elif mode == 'wrap': - mode_c = ord('W') - elif mode == 'reflect': - mode_c = ord('R') + cdef char mode_c = ord(mode[0].upper()) cdef int out_r, out_c if output_shape is None: