Code Duplication    Length = 4-4 lines in 3 locations

includes/class-wc-geo-ip.php 3 locations

@@ 1412-1415 (lines=4) @@
1409
1410
		// Get region
1411
		$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1412
		while ( $char != 0 ) {
1413
			$str_length++;
1414
			$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1415
		}
1416
1417
		if ( $str_length > 0 ) {
1418
			$record->region = substr( $record_buf, $record_buf_pos, $str_length );
@@ 1426-1429 (lines=4) @@
1423
1424
		// Get city
1425
		$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1426
		while ( $char != 0 ) {
1427
			$str_length++;
1428
			$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1429
		}
1430
1431
		if ( $str_length > 0 ) {
1432
			$record->city = substr( $record_buf, $record_buf_pos, $str_length );
@@ 1440-1443 (lines=4) @@
1437
1438
		// Get postal code
1439
		$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1440
		while ( $char != 0 ) {
1441
			$str_length++;
1442
			$char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) );
1443
		}
1444
1445
		if ( $str_length > 0 ) {
1446
			$record->postal_code = substr( $record_buf, $record_buf_pos, $str_length );